Filter löschen
Filter löschen

How to extract x, y data values from matlab figure?

1.036 Ansichten (letzte 30 Tage)
Prasanna
Prasanna am 19 Feb. 2018
please find the attachment; in the figure, there are two data values. i need the x and y values of this data.

Akzeptierte Antwort

KSSV
KSSV am 20 Feb. 2018
Open the figure:
h = findobj(gca,'Type','line')
x=get(h,'Xdata') ;
y=get(h,'Ydata') ;
(x,y) is your required data.
  6 Kommentare
Siddhartha Ganguly
Siddhartha Ganguly am 20 Mai 2022
Bearbeitet: Siddhartha Ganguly am 20 Mai 2022
Hi, how can I extract data andd save as mat file from a figure which has 3 subplots, like this:
Zack Trahem
Zack Trahem am 19 Jul. 2022
let say i have y values and need to find the corresponding location, can we find the unspecified location? As an example on figure i want to find the time of the 68.5 m/s ??

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (2)

Shahid Abbas
Shahid Abbas am 10 Feb. 2021
If you want to get the values of unknown points from the figure and have to use in code then this could be helpful.
delete 2.fig;
savefig('2.fig');
open('2.fig');
h = gcf; %current figure handle
axesObjs = get(h, 'Children'); %axes handles
dataObjs = get(axesObjs, 'Children'); %handles t
xdata = get(dataObjs, 'XData');
ydata = get(dataObjs, 'YData');

shubham kumar gupta
shubham kumar gupta am 10 Sep. 2022

Kategorien

Mehr zu Migrate GUIDE Apps finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by