Answered
How to find the point where most lines intersect in a binary image?
A good solution would be to identify each line by e.g. Hough transform, determine each intersection (e.g. <https://se.mathworks....

7 years ago | 1

| accepted

Answered
One Plot two different y-axis, how to scale second y-axis?
Probably not what you want, but perhaps one step closer: x=[0 100 300 500 800 800] y1=[0 100 180 200 255 260] y2=[155...

7 years ago | 0

| accepted

Answered
How to replace certain cells in heatmap with "Not Detected"?
Best you can do is probably to set all zeros to NaN and then add this line set(gca,'missingdatalabel','not detected') Z...

7 years ago | 0

| accepted

Answered
How do I combined all peak to become one spectral line?
They key is to resample the curves along a common x-vector. You can do this by interp1. Just add these new lines of code: ...

7 years ago | 1

| accepted

Answered
Count two columns with corresponding data
Try this: x is speed, y is direction sum(x>0 & x<3 & y>0 & y<45) the conditions inside of the braces gives a logical...

7 years ago | 0

| accepted

Answered
Filtering timeseries with NaN
It's easier to use logical indexing. If _good_ data lies below a certain threshold, then _bad_ data lies above that threshold. S...

7 years ago | 0

| accepted

Answered
How to avoid marker clipping while saving two axis figure to pdf?
Not the first time I see clipping issues with plotyy. Simple solution, avoid using plotyy % Create two axes ax(1)=axes('...

7 years ago | 0

| accepted

Answered
how to overlay multiple images using scatter3?
This is a continuation of <https://se.mathworks.com/matlabcentral/answers/418703-how-to-plot-by-scatter3-a-3d-matrix-with-its-el...

7 years ago | 0

| accepted

Answered
How can i insert a vector in a position into a matrix that already has values?
A is your matrix B is your vector out=[A(1,:);B;A(2:end,:)];

7 years ago | 0

| accepted

Answered
pltoting a variable with dates on horizontial axis
Here is something you can work from. I used a trick with the |stairs| and |area| functions to make the shaded bars. It may have ...

7 years ago | 2

Answered
How can i create efficiency isolines in a compressor map?
This is what I'm getting from the data you uploaded. %% Load data rpm{1}=xlsread('data_compressor_map.xlsx','A3:D10'); ...

7 years ago | 0

| accepted

Answered
Legend for scatter plot has lines through markers
The third argument in |plot| sets the line style *and* markerstyle. If you do not specify a 3rd argument then |plot| assigns a l...

7 years ago | 0

| accepted

Answered
how to plot by scatter3 a 3D matrix with its elements being logic variables?
You can use your logic data in A to set the color and your X, Y and Z data for coordinates. scatter3(X(:),Y(:),Z(:),[],A(...

7 years ago | 1

| accepted

Answered
How to trim data in a matrix?
X(0) is not a valid index. Try this: X(:,[1:130,589:end])=[]; This removes the columns from 1 to 130 and 589 onward, so ...

7 years ago | 2

| accepted

Answered
Changing the axes in a figure from geographical coordinates to distance in km
I found your figure in another question and attached it to this answer. You could try something like this: % Units of lat/l...

7 years ago | 1

Answered
Plot a timeseries in a group?
You can try this code. I used some messy dynamic field naming to do the plots. Will clean this up tomorrow, but too tired right ...

7 years ago | 2

| accepted

Answered
How to find a point in a dataset at which graph is changing (aka whole graph derivative)
findchangepts has a number of <https://se.mathworks.com/help/signal/ref/findchangepts.html#namevaluepairs *optional inputs*> . T...

7 years ago | 0

Answered
How to scale axis of a contour graph?
Just use the actual x and y-data as input to contour. If you do not specify x and y-data then contour just plots the data agains...

7 years ago | 1

| accepted

Answered
Find intersection of two guassian curves
If you have only one intersection, then you can just find the minimum difference [~,idx] = min(abs(y1 - y2)) This will ...

7 years ago | 0

| accepted

Answered
How can i create an image with randomly distributed filled circles (not only the contours), having different colours?
You could try using |viscircles| % image size xres = 640; yres = 480; % radii & centers n = 200; rr = ra...

7 years ago | 0

Answered
Is there a faster way to change zeros to ones and ones to zeros?
You can do A = ~A however it returns a logical, so if you want a uint8 you have to: A = uint8(~A)

7 years ago | 4

| accepted

Answered
How to show values on heatmap belonging to a different dataset.
Here's an example using |imagesc| and |text| % Grid [X,Y]=meshgrid(1:10,1:10); % Two data sets to compare A=ra...

7 years ago | 3

| accepted

Answered
XtickLabels on plots or scatters
Something like this? x = 1:5 A = [2,3,4,5,6] figure scatter(x,A) set(gca,'xtick',x,'XTickLabel',{'a','b','c',...

7 years ago | 0

| accepted

Answered
Here is my code. I am trying to draw 3 lines in one graph, but only two of them are shown in the graph. What is the problem with the black one?
Probably the background of ax2 is hiding ax1. Try this: set([ax1 ax2], 'color', 'none')

7 years ago | 0

Answered
How can I filter data outside of a polygon border?
I'm guessing the problem is that your data is structured in gridded format, as you'd get from |meshgrid|. Try: [in,on] = in...

7 years ago | 0

Answered
How do I create a string for values
The class of P is double. You cannot put a string in a double, because a string is not a number. Try replacing the final loop wi...

7 years ago | 0

| accepted

Answered
Making a graph from my Matrix
A is your matrix x=[1 4 7 10]; plot(x,A(A(:,5)==1,1:4),'r') plot(x,A(A(:,5)==0,1:4),'b')

7 years ago | 0

Answered
Using yyaxis how do I limit and select a range for the y and x axis?
Your syntax is a bit off *set axes limits* % two element vector with min/max xlim([5 50]); *set axes ticks* %...

7 years ago | 1

Answered
InterX not accurate for one intersection point
It's because you're comparing the points one loglog scale. I suspect InterX uses linear interpolation to find the point of inter...

7 years ago | 0

Load more