Extract large set of data from Matlab plots in a excel Sheet in a particular format
조회 수: 1 (최근 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.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1070340/image.png)
댓글 수: 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에서 Spreadsheets에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!