I was using matlab to make several figures and i had saved them in the fig format.
Get data from matlab fig.
You ll get some other value depending on state of rng at the time but the process should be clear to retrieve the data from the plot and find a location.
A while later i misplaced the original data and i wanted to see if i could regain access to the data from the figure file.
To find what data you want check properties.
One can also step through the figure data in matlab by loading the figure using the command s load figure fig mat.
So i needed to extract the data of curve fitting tool.
I have seen tutorials where matlab figures where converted to data but could not find one that handled extraction of data from subplots.
Now xydatas will be a cell array with one entry for each object in the plot that has an xdata property.
I have a matlab figure with 12 subplots 6x2 figures and i intend to convert certain subplots into data whose position i know.
Note that the dot notion feature is available starting from matlab 2014b so instead of using the get function you may do the following.
Show hide all comments.
Let s say you have a curve and want get.
It took me a while and i had to dig pretty deep to find it but i finally found it and i m posting it here to hopefully help you.
Nb that if your x values are non integer values you may need to make the comparison fuzzy rather than exact as is shown here.
How to extract data if figure has two independent plots the above code is extracting data from one plot of the figure 0 comments.
As much as i like matlab figures i usually find excel features more desirable for good looking plots.
The solutions using get never really worked for me.
If your fig file is opened pull it to active current window.
Make a m file with the following code to get the x y data of the curve.
I think this is because every figure is structured slightly differently and people are posting solutions that work for a particular figure but don t generalize.
Save the figure as a fig file.