I have a few MATLAB figures, but no MATLAB code associated with it. I want to extract the data from the curves in the figures.
This example shows how to extract data from a MATLAB figure.
If the figure is stored in a file, such as 'example.fig', then open the figure file using 'openfig'. Assign the Figure object to the variable 'fig'.
fig = openfig('example.fig');
If the figure is already open, then use 'gcf' to access the Figure object and assign it to the variable 'fig'.
fig = gcf;
axObjs = fig.Children dataObjs = axObjs.Children
The 'dataObjs' array that appears in the Command Window indicates the types of graphics objects in the axes. Different graphics objects store data differently. For example, Line objects store the data in the 'XData', 'YData', and 'ZData' properties. If the first element in 'dataObjs' is a Line object, then access its data using this code.
x = dataObjs(1).XData y = dataObjs(1).YData z = dataObjs(1).ZData
Alternatively, you can find all the graphics objects in a figure with a certain data property. For example, find all graphics objects that have a 'YData' property. Then access the 'YData' values for the first object.
dataObjs = findobj(fig,'-property','YData') y1 = dataObjs(1).YData
Matlabsolutions.com provides guaranteed satisfaction with a
commitment to complete the work within time. Combined with our meticulous work ethics and extensive domain
experience, We are the ideal partner for all your homework/assignment needs. We pledge to provide 24*7 support
to dissolve all your academic doubts. We are composed of 300+ esteemed Matlab and other experts who have been
empanelled after extensive research and quality check.
Matlabsolutions.com provides undivided attention to each Matlab
assignment order with a methodical approach to solution. Our network span is not restricted to US, UK and Australia rather extends to countries like Singapore, Canada and UAE. Our Matlab assignment help services
include Image Processing Assignments, Electrical Engineering Assignments, Matlab homework help, Matlab Research Paper help, Matlab Simulink help. Get your work
done at the best price in industry.