Problem saving the figures
조회 수: 1 (최근 30일)
이전 댓글 표시
I need to save figures produced by a function. The figures are open in matlab Iused this code:
save_jpegs='C:\Users\jpegs';
save_figs='C:\Users\figs';
number_of_figures=findobj('type','figure');
for i=1:length(number_of_figures)
saveas(figure(i),fullfile(save_jpegs,[ num2str(i) '_' figures(i).Name '.jpeg']));
saveas(figure(i),fullfile(save_figs,[ num2str(i) '_' figures(i).Name]));
end
I recieve thie error:
Undefined variable "figures" or class "figures".
any idea why?
댓글 수: 0
채택된 답변
Walter Roberson
2020년 1월 21일
As outside observers, we have no reason to expect that a variable named figures exists.
save_jpegs = 'C:\Users\jpegs';
save_figs = 'C:\Users\figs';
figures = findobj('type','figure');
for i = 1 : length(figures)
saveas(figures(i), fullfile(save_jpegs,[ num2str(i) '_' figures(i).Name '.jpeg']));
saveas(figures(i), fullfile(save_figs,[ num2str(i) '_' figures(i).Name]));
end
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Interactive Control and Callbacks에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!