save several plots in seperate files within a live script
이전 댓글 표시
hello there,
i have a live script which plots the results at its end. it creates a new figure and title and so on. now i want to save all the figures. the figures are being created in a function, cause there is a lot of different data, but more or less the same plot.
i have found 2 solutions so far, whcih sadly dont work.
the first solution i used had the problem that it doesnt save it according to the names. they just have no name and there are overwriting each other. another problem is, that out ofnowhere it gave me the error that the folder is incorrect. i made another folder for the plots and the folder does exist, matlab knows the folder i added it.
the 2nd solution gave me the following error message
댓글 수: 3
Nathan Hardenberg
2023년 5월 23일
You forgot to paste the error message from the second solution
Walter Roberson
2023년 5월 23일
채택된 답변
추가 답변 (1개)
Andre
2023년 5월 24일
댓글 수: 1
Nathan Hardenberg
2023년 5월 24일
편집: Nathan Hardenberg
2023년 5월 24일
Don't confuse Name and Title. The name is given to the figure when it is initialized (see following Code). The Title is the "Title" of the Axis-object, which is a child of the figure-object. If you would initialize all figures like seen below, the code from the solution1 should work. But by default no name is given to a figure.
fig1 = figure("Name", "myName");
fig1.Name
fig2 = figure;
fig2.Name
And nice to see that you found a way it works for you
카테고리
도움말 센터 및 File Exchange에서 Labels and Annotations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!