Community Profile # Karim

Last seen: 2 días ago Active since 2016

Mechanical Engineer

Programming Languages:
MATLAB
Spoken Languages:
English
Professional Interests:
Optimization, Multibody Modeling, Finite Element Analysis (FEA)

#### Statistics

All
• • • • • • • • • #### Content Feed

View by

how to plot deformation with value from ansys to matlab
you can use the patch command, see the method below coordinates = readmatrix("coordinates.csv"); displacements = readmatrix(...

2 días ago | 0

| accepted

Sort according to specific string contained in file name
You can try spliting the lists, then ordering them and then using the indixes to sort the original list: ListA = ["010822_AB030...

2 días ago | 0

| accepted

Extract certain numbers from a text file.
see below for one method to do this % read the file MyData = readmatrix('example_txt_file.txt'); % specify frequency valu...

2 días ago | 0

How to seprate elements based on value counts In MATLAB
If i understand it correctly, you want to keep only the unique values from each cell and find the overal "count" of each value? ...

3 días ago | 0

Truble codeing a diamond lattice
You need the additional subroutines. In this case "diamondLattice.m" and all other routines accompined by it... After a quick b...

3 días ago | 0

Making a 3D plot and rotating it
@Sam Chak as requested a seperate answer to show the "patch" approach As mentioned in the comments, there remains a part to com...

3 días ago | 1

| accepted

How can I name the x-axis elements on a plot?
Here you go, you can overwrite the ticks with a string: % data M = [1 2 3 4 5 6 7 8 9 10 11 12]; Months = ["Jan","Feb","Mar",...

3 días ago | 1

| accepted

How to find the time between two spikes?
hello, you can use the "findpeaks" routine do achieve this, see below for the code best regards % first run the main code M...

3 días ago | 0

| accepted

Making a 3D plot and rotating it
To create a figure like the tower of hanoi, you can try something like the code below. Have fun :) edit: added the rotation a...

4 días ago | 1

How to plot graph between "W" and "r" for multiple values of "psi" on the same figure?
the easiest would be to "hold" the plot and loop over the values, see below % plotting graphs syms r psi_list = [0.1, 0.01, 0...

4 días ago | 0

| accepted

how to delete all row contain a 1's and how to delete a column contain 1's. Q=[3 1 1 0 0 1;1 3 1 0 1 0;1 1 3 1 0 0;0 0 1 3 1 1;0 1 0 1 3 1;1 0 0 1 1 3]
you can use some logic to find them: % using example data Q = [3 1 1 0 0 1;1 3 1 0 1 0;1 1 3 1 0 0;0 0 1 3 1 1;0 1 0 1 3 1;1...

4 días ago | 0

Is there a way to write values ​​where the last digits of the value are the ones that separate them, but only use 6 digits, plus the exponent?
the only way I can think of that matlab can deal with such big numbers and precision is by treating them as strings ( perhaps it...

4 días ago | 0

To minimize the charging cost of electric vehicles
Which error do you obtain? I changed if j<=EVSE1_arr_time & j<=EVSE1_leave_time into if all(j<=EVSE1_arr_time) && all(j<=E...

4 días ago | 0

How to store value in the table using looping
hello, below you can find an example on how to store data in a table in a loop numLoop = 10; % indicate the number of loops.....

4 días ago | 0

| accepted

how to resize a matrix two pair of two numbers stacked together?
you can do this with the reshape command: a = (1:16)' b = reshape(a, 4, [] )

4 días ago | 0

Removal of empty cells in an array
this was due to the indexing, you were putting the temporary data into "nn{n1,n} = F1{n1}", thus at the second run of "n" a new ...

4 días ago | 0

| accepted

how to plot a plane using equations of planes?
does this result in what you need? Edit: update to plot a plane at each point and plot the normal using quiver XYZ = [ 126.604...

4 días ago | 0

| accepted

how to do the matrix value comparison of two different iterations ?
yes, you can do this like you say by saving the best result and updating it at each iteration i tried to update the pseudo code...

4 días ago | 0

| accepted

Index of matrix using colon
you need to save the index value into a new array, otherwise it will overwrite the value and only keep the last one mainmatrixX...

5 días ago | 0

I want put test 3 sigma on time series by 800*1 dimension. I have this code, it return nothing.
the error is because you intialize lat = fid(:,2); this means that 'lat' will be a vector with 1 column next you ask for l...

5 días ago | 0

How can I transfer the results of a four-cycle iteration into a matrix with a row for each iteration?
hello, if you want to use the for loop you need to index the rows A=[0.246 0.280 0.286 0.301 0.302 0.330 0.397 0.478 0.607 0.65...

5 días ago | 1

| accepted

Indexing a cell using a table
i gues you need to translate the logical matrix B into indexes, e.g. using find % create A A = {[1;2;3] [4;5;6] [7;8;9] ; [10;...

5 días ago | 0

| accepted

How can I control the amount of same random letters back to back? (N-back)
Quite an interesting problem, I'm not familiar with a n-back experiment. But I guess one of the issues could be that your 'integ...

5 días ago | 0

| accepted

How to generate a multi-dimensional array from a vector ?
see below for an example. i used several for loops for sake of readability % pick the numer of dimensions e.g. 4 M = 4; % gen...

6 días ago | 0

How to button to load the MS-paint in GUI?
You can try using the system command and link it to the location of MS Paint on your computer: system('"C:\WINDOWS\system32\msp...

6 días ago | 0

Binning data into 1 hour average in cell array?
Hello, If you know how to proces the data for a single file, you can use the same logic in a loop. At the begining of the loop ...

6 días ago | 0

Split one colum excel data to 3 colums
Hey, Due to both the ' " ' and the comma's I would to read the file as strings and then extract the data you need. See the code...

6 días ago | 0

how can I plot scatterplot using scatter or gscatter with different color for each variable
I'm not completly sure if I fully understand the question. But the 4th input for the scatter command can be used to indicate th...

9 días ago | 1

| accepted

how to extract all values in array after certain value?
Hi, Assuming that the part you need is between two random number, you can try the following: Data = [1 0 0 2 0 0 3...

9 días ago | 2

| accepted