Hi! I have a whole lot of script files and figures. What I want to do is find the script file that generated a particular figure. Is there a way I can do this?
Thanks in advance.

댓글 수: 2

Geoff Hayes
Geoff Hayes 2016년 1월 29일
Aravindh - perhaps tag each figure name with a unique script identifier so that you can relate the two. Or are you trying to match the two after the fact?
Aravindh Rajan
Aravindh Rajan 2016년 1월 29일
Yes, I am. Unfortunately, I simply acquired a mass of figures and scripts. I am making an assumption that the person who worked on it saved the figures using the script itself. Is there a way I can find the script in this case.
I'm pretty sure I cannot do this if the person generated the figure and saved it manually afterwards.

댓글을 달려면 로그인하십시오.

 채택된 답변

Walter Roberson
Walter Roberson 2016년 1월 30일
편집: Walter Roberson 2016년 1월 30일

0 개 추천

Unfortunately, no, when savefig() is done, the name of the calling function or script is not recorded.
(Exception: .fig files saved by GUIDE itself have the filename buried in them in the ApplicationData property GUIDEOptions structure. On the other hand those .fig are always named the same thing as the corresponding .m except with the different extension, so this is of little use, and is irrelevant to your situation anyhow.)
If you have an example figure for each script, you can (automatically) compare the properties of the example figure against each target figure to determine the plausibility that the script was used. This would be easiest in the case where the script did not have multiple options about figures to produce. For example, it is possible to programmatically search .fig files looking for the title() field of axes, since different scripts tend to title .fig differently.
I am assuming here that when you say "figure" that you are referring to a .fig file, not to an image file. Image files are more difficult to analyze by program.

댓글 수: 1

Aravindh Rajan
Aravindh Rajan 2016년 1월 31일
Thank you for the answer, Walter. I will look into searching the axes and figure titles.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Printing and Saving에 대해 자세히 알아보기

질문:

2016년 1월 29일

댓글:

2016년 1월 31일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by