Risposto
How can I create dynamic variables A1, A2,...,A10 in a loop and save them?
You could use |eval| to do what you are asking, BUT YOU SHOULD NOT DO THAT. Instead you could use the values of the arguments...

circa 9 anni fa | 1

Inviato


CigarScatterPlot
Make a categorical scatter plot without overlapping markers, resulting in a cigar-shape

circa 9 anni fa | 1 download |

0.0 / 5
Thumbnail

Risposto
How to Place A and B matrix's elements to C matrix?
I don't see any obvious way to do this, so the code below is a bit inelegant. random_vals=num2cell(rand(32,1));%generate ra...

circa 9 anni fa | 0

Risposto
how to create an image in Matlab from .txt file?
It might work to simply use |IM(x,y)=z;| instead of the loop, but that is left as an exercise to the reader. data = importd...

circa 9 anni fa | 0

Risposto
How to substitute numbers in a string with repeated strings?
My first thought is using |repmat|, but usually when my first thought is |repmat|, there is a better solution using |sprintf|. S...

circa 9 anni fa | 0

Risposto
I am getting an error in imshow which i have posted as follows. Let me know what can I do ?
It looks like you have written your own function with the name |gray|, which somewhere along the line tries to call the inbuilt ...

circa 9 anni fa | 0

Risposto
How to find the position of black pixels in black and white intensity image?
You clearly haven't done anything recommended <https://www.mathworks.com/matlabcentral/answers/6200-tutorial-how-to-ask-a-questi...

circa 9 anni fa | 0

Risposto
how does the function findpeaks work in matlab?
Excerpt from the <https://www.mathworks.com/help/signal/ref/findpeaks.html documentation>: |pks = findpeaks(data)| returns a ...

circa 9 anni fa | 0

Risposto
Kindly help to find the percentage of pixels that lies between 50 to 100 gray scale level between x and y plane in a histogram.
Use logical statements to find out which pixels match the ranges, then count the number of pixels, then divide by number of pixe...

circa 9 anni fa | 0

Risposto
Good afternoon I'm trying to combine some bar graphs I have created. I tried with 'hold on' but it doesn't work, maybe because I have used the for loop.
You can vectorize this and then plot the resulting matrix/vectors in one go with |bar|. Hints: * If you can't get a vector...

circa 9 anni fa | 2

Risposto
How to scan for the max of a column for a csv file, and then select other cells from the same row?
You should have a look at the documentation. If you type |doc max|, you will notice that you can also get the index of the max v...

circa 9 anni fa | 0

Risposto
How can I count the number of swaps that occur when sorting a vector?
If you mean how many steps the algorithm has taken, that is impossible and might change between Matlab releases. If you want to ...

circa 9 anni fa | 1

| accettato

Risposto
Error message "Error using EXIST, The first input to exist must be a string."
The first input to |ode45| must be a function handle. That means that you should have entered this: [t,x] = ode45(@rates,ts...

circa 9 anni fa | 0

| accettato

Risposto
Faster version of dec2bin and bin2dec function for an image
I2=mat2cell(dec2bin(img,8),ones(65536,1),8); I3=cell2mat(reshape(I2',256,256)); checkval=I-I3; any(checkval(:)) Th...

circa 9 anni fa | 1

Risposto
What is the function of flag?
The answer can be found in the documentation (just type |doc filter2|). "The filter2 function filters data by taking the 2-D ...

circa 9 anni fa | 0

Risposto
how to plot contour with 3 dimensional data
I think the first result on Google will the |contour| function. doc contour That will teach you a lot about what syntax ...

circa 9 anni fa | 0

Risposto
Move files to a new folder for every model run
You mean something like this? movefile([runpath sprintf('newfile_%d.txt',run_number)],sprintf('E:\\Tutorial\\Results\\Run_%...

circa 9 anni fa | 0

Risposto
How use of sprintfunction to load .dat file, mathematical operation, save as.txt file in a loop?
I was surprised that your load command actually worked, so I took a look at the <https://www.mathworks.com/help/matlab/ref/load....

circa 9 anni fa | 1

| accettato

Risposto
How to extract x,y,z coordinates from a contour?
The culprit is in this code snippet: [c,h]=contour(X,Y,Z,v); xcg=get(get(h,'children'),'xdata'); ycg=get(get(h,'childre...

circa 9 anni fa | 1

Risposto
How to add "for loop"
You're in luck. I usually ignore questions that don't show that the person asking has followed the advice from the <https://www....

oltre 9 anni fa | 0

| accettato

Risposto
How to solve for a b c d ?? If i have 4 equations like these in matlab.
If you take a look at the <https://www.mathworks.com/help/symbolic/solve.html#buql15h-5 documentation>, you will notice that you...

oltre 9 anni fa | 0

Risposto
I have drawn a profile using plot. I need to find the area of that. please do help me
My other answer assumed that you had a profile graph, not some contour. There is a Matlab function for measuring the area of ...

oltre 9 anni fa | 0

Risposto
Selecting a range of rows at a time
You can replace your code with the code below, although it will not be any faster than the code you describe. fs = 300 f...

oltre 9 anni fa | 1

Risposto
How to close a wiatbar when an error occurs before the delete command?
You can use |try| and |catch| to catch any errors and close the waitbar. try % all your code catch ME dele...

oltre 9 anni fa | 0

| accettato

Risposto
I have drawn a profile using plot. I need to find the area of that. please do help me
The |trapz| function does a numerical integration for you, which is the area under the curve.

oltre 9 anni fa | 0

Risposto
How to plot multiple plots repeatedly from a loop?
There are two options: use a specific figure number for each plot, or use a handle for the two figures. I would advise the first...

oltre 9 anni fa | 1

| accettato

Risposto
How to index into the result of a function directly without allocating?
As far as I know, this is only possible for nested cells. You can do exactly this in Octave, but that has other disadvantages.

oltre 9 anni fa | 1

Risposto
Bar chart is not plotted evenly over the X-axis!
I don't know why, but you can easily fix this with the _axis_ command, or on newer releases with the _xlim_ command. try ...

oltre 9 anni fa | 1

| accettato

Risposto
How to optimize my Matlab code ?
What you are asking for is not actually optimization, but rather code compactness. Therefor, I'm going to ignore the actual opti...

oltre 9 anni fa | 1

| accettato

Risposto
Hey Guys can you help me with that.
You don't have to do anything special to the input, as the question states that the input will always be a string. This string i...

oltre 9 anni fa | 0

Carica altro