why won't this plot?
Ältere Kommentare anzeigen
for i = 1:length(xaxis); if xaxis(i) >0; plot(xaxis(i),yaxis(i)); end
end;
xaxis and yaxis have numbers. I always get a blank plot space
Akzeptierte Antwort
Weitere Antworten (3)
Massimo Zanetti
am 4 Okt. 2016
Yes, because you are plotting just on point. Better try this:
plot(xaxis,yaxis)
Gareth Thomas
am 4 Okt. 2016
Bearbeitet: Gareth Thomas
am 4 Okt. 2016
You need to add the hold on command. Try this:
for i = 1:length(xaxis); hold on;if xaxis(i) >0; plot(xaxis(i),yaxis(i),'x'); end; end;
Notice the 'x' which helps you see it.
Gareth Thomas
am 4 Okt. 2016
for i = 1:length(xaxis); hold on ;if xaxis(i) >0; plot(xaxis(i),yaxis(i),'x'); end; end;
Kategorien
Mehr zu 2-D and 3-D Plots finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!