Extract large set of data from Matlab plots in a excel Sheet in a particular format
2 次查看(过去 30 天)
显示 更早的评论
I am trying to get all the data out of the below plot. I have been able to extract the data for each X and Y axis, But I need to automate the process. I appreciate any comment. So what I need is data from each of the configuarion such as 288.10 and save then in a matrix in matlab and print a excel file , with four columns XR-X axis, XR-Y axis, XI-X axis, XI-Y axis. I am looking to get one excel sheet for each of the set. That means 2888.10, 288.100, 288.340 .... and so on. The .fig file is too large to share. I am sharing a jpeg image.
1 个评论
dpb
2022-7-19
Pretty straightforward presuming it is just a normal plotted set of lines and wasn't from one of the fancy toolbox specialty plots -- and doesn't look like would have been.
Kinda' tedious, but not difficult --caution -- air code, untested, just the outline of what to do programmatically ---
hF=openfig('yourfigure.fig'); % handle to the figure
hAx=findobj(hF,'type','Axes'); % and to the axes object
hLg=findobj(hF,'type','Legend'); % then the legend also child of figure
hL=findobj(hAx,'type','Line'); % and then the lines
Now just iterate over the line handles -- if legend was used,then
hL(i).DisplayName
will return the legend string.
It's not clear the annotation was done with legend, though, with the disparate locations unless there are two axes; one for each set of plots overlaid over each other.
There's too much ambiguous about how the plot was done to write precise code...moral--save the data when drawing the figures! :)
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Annotations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!