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

más de 7 años hace | 1

| aceptada

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

más de 7 años hace | 0

| aceptada

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

más de 7 años hace | 0

| aceptada

Respondida
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: ...

más de 7 años hace | 1

| aceptada

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

más de 7 años hace | 0

| aceptada

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

más de 7 años hace | 0

| aceptada

Respondida
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('...

más de 7 años hace | 0

| aceptada

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

más de 7 años hace | 0

| aceptada

Respondida
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,:)];

más de 7 años hace | 0

| aceptada

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

más de 7 años hace | 2

Respondida
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'); ...

más de 7 años hace | 0

| aceptada

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

más de 7 años hace | 0

| aceptada

Respondida
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(...

más de 7 años hace | 1

| aceptada

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

más de 7 años hace | 2

| aceptada

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

más de 7 años hace | 1

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

más de 7 años hace | 2

| aceptada

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

más de 7 años hace | 0

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

más de 7 años hace | 1

| aceptada

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

más de 7 años hace | 0

| aceptada

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

más de 7 años hace | 0

Respondida
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)

más de 7 años hace | 4

| aceptada

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

más de 7 años hace | 3

| aceptada

Respondida
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',...

más de 7 años hace | 0

| aceptada

Respondida
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')

más de 7 años hace | 0

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

más de 7 años hace | 0

Respondida
How to create a column of defined values fixing the first and the last positions
linspace(0.7,3.5,1001)'

más de 7 años hace | 0

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

más de 7 años hace | 0

| aceptada

Respondida
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')

más de 7 años hace | 0

Respondida
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* %...

más de 7 años hace | 1

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

más de 7 años hace | 0

Cargar más