How to extract x, y data values from matlab figure?
Show older comments
please find the attachment; in the figure, there are two data values. i need the x and y values of this data.
1 Comment
Star Strider
on 19 Feb 2018
Accepted Answer
More Answers (2)
Shahid Abbas
on 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');
Categories
Find more on Develop Apps Programmatically in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!