필터 지우기
필터 지우기

"Invalid Handle" error message occurs

조회 수: 4 (최근 30일)
Don
Don 2017년 10월 31일
댓글: Don 2017년 10월 31일
I have the following very simple code:
fprintf(' Select Folder to store output plots and files \n');
FigPath = uigetdir('C:\Projects', ' Select Folder to store output plots ');
%FigPath = cat(2,FigPath,'\');
name = cat(2,name,'.png');
saveas(FigPath,name); % save plot to subj directory
Other Matlab programs have the very same code and work fine. Note that the %-statement adds a backslash, which doesn't help either.
Please: what's going on?

채택된 답변

Fangjun Jiang
Fangjun Jiang 2017년 10월 31일
Pay attention to the syntax of saveas(). The first argument should be the handle of the figure, not the path of your saved file.
Also, fullfile() might be better than cat() in your case.
  댓글 수: 1
Don
Don 2017년 10월 31일
That seemed to fix it. Thanks

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Environment and Settings에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by