Help with building plot

3 Ansichten (letzte 30 Tage)
Lev Mihailov
Lev Mihailov am 30 Aug. 2019
Kommentiert: Adam am 30 Aug. 2019
x=[1:2:50] % this x coordinate where I need to plot
X=[24 23 23 25 26] % values ​​where to be y
[~,psk]=min(Data) % matrix 200x10
for i=1:n % n = 10
y(i)=psk(i)-2
p=length(x);
Data=Data(1:p,i);
Y=Data(y(i):psk);
end
plot(Data,x)
Hello! Help with this problem, when plotting the Data graph from x, my values ​​do not coincide much
  1 Kommentar
Adam
Adam am 30 Aug. 2019
I don't really know what you are trying to do, but this statement:
Data=Data(1:p,i);
in your loop collapses your 200x10 matrix down to a vector that overwrites your original data, so that 2nd time round the loop (if indeed it even gets that far) you will get an error because i = 2, but Data is size (25,1)

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange

Tags

Produkte

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by