Answered
How to start my plot from the beginning of the x-axis?
You can use the |xlim| function (or on older releases the |axis| function) to do this. But as |xlim| only accepts numerical inpu...

9 years ago | 1

Answered
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...

9 years ago | 1

Submitted


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

9 years ago | 56 downloads |

0.0 / 5
Thumbnail

Answered
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...

9 years ago | 0

Answered
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...

9 years ago | 0

Answered
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...

9 years ago | 0

Answered
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 ...

9 years ago | 0

Answered
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...

9 years ago | 0

Answered
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 ...

9 years ago | 0

Answered
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...

9 years ago | 0

Answered
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...

9 years ago | 2

Answered
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...

9 years ago | 0

Answered
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 ...

9 years ago | 1

| accepted

Answered
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...

9 years ago | 0

| accepted

Answered
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...

9 years ago | 1

Answered
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 ...

9 years ago | 0

Answered
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 ...

9 years ago | 0

Answered
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_%...

9 years ago | 0

Answered
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....

9 years ago | 1

| accepted

Answered
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...

9 years ago | 1

Answered
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....

9 years ago | 0

| accepted

Answered
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...

9 years ago | 0

Answered
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 ...

9 years ago | 0

Answered
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...

9 years ago | 1

Answered
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...

9 years ago | 0

| accepted

Answered
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.

9 years ago | 0

Answered
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...

9 years ago | 1

| accepted

Answered
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.

9 years ago | 1

Answered
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 ...

9 years ago | 1

| accepted

Answered
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...

9 years ago | 1

| accepted

Load more