Is it possible to save plotted points?
Ältere Kommentare anzeigen
The general idea is that I am plotting a parabola and using 'r.' to plot it in red dots.
Is there a way I can save these dot/points? I need the location, and I am randomly generating the parabola so this would definitely be ideal.
If not, could I have a suggestion to best do what I am hoping to acheive? I am sure more info is needed, so please ask away and I can clarify.
Antworten (1)
Rik
am 19 Aug. 2020
0 Stimmen
Either save the data you use to create the plot, or retrieve that data from the XData and YData properties of the line object created by plot.
7 Kommentare
Kayleigh Movalli
am 19 Aug. 2020
Rik
am 19 Aug. 2020
What code are you using to create the plot?
Kayleigh Movalli
am 24 Aug. 2020
Rik
am 24 Aug. 2020
So why can't you save x and y directly? Anyway, the code below shows what I mean.
h=plot(x,y);
x=h.XData;y=h.YData;
Adam Danz
am 24 Aug. 2020
Kayleigh Movalli
am 25 Aug. 2020
Adam Danz
am 25 Aug. 2020
If you weren't expecting imaginary components, that's usually a sign that something in your analysis isn't working the way it's intended. You could extract the real part using real(x) which is 0 but I doubt that would address the real problem, unless you're expecting a complex number.
Kategorien
Mehr zu Annotations finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!