MATLAB Answers

0

How can I expand x axis to have normal plot?

Asked by Jaehwi Bong on 14 May 2019
Latest activity Answered by Stephan
on 14 May 2019
I have 500 values of x and y.
When I plotted it, I got something weird plot.
What can I do for that?
t=data{:,1};
y=data{:,2};
plot(t,y)

  0 Comments

Sign in to comment.

1 Answer

Answer by Stephan
on 14 May 2019
 Accepted Answer

A(:,1)=data{:,1};
A(:,2)=data{:,2};
A=sortrows(A,1);
plot(A(:,1),A(:,2))

  0 Comments

Sign in to comment.