What does this Error code mean ?

조회 수: 20 (최근 30일)
Siva Ratnasingam
Siva Ratnasingam 2018년 5월 24일
편집: per isakson 2018년 5월 24일
Error using checkArgsForHandleToPrint
Handle input argument contains nonhandle values.
Error in checkArgsForHandleToPrint
Error in print>LocalCreatePrintJob (line 100)
handles = checkArgsForHandleToPrint(0, varargin{:});
Error in print (line 38)
[pj, inputargs] = LocalCreatePrintJob(varargin{:});
Error in saveas (line 181)
print( h, name, ['-d' dev{i}] )
Error in S_1 (line 200)
saveas(gcf, cell2mat(fileName),'jpg');
Error in MainScript (line 21)
S_1; clearvars;

답변 (1개)

per isakson
per isakson 2018년 5월 24일
편집: per isakson 2018년 5월 24일
Deep in the code of Matlab itself
Handle input argument contains non handle values
a nonhandle value was passed where a handle was expected. That in turn was caused by
Error in S_1 (line 200)
saveas(gcf, cell2mat(fileName),'jpg');
a saveas in your function, S_1, at line 200. Put a breakpoint at saveas and run the code. At the breakpoint inspect the values that are passed to saveas
K>> h = gcf
h =
Figure (1) with properties:
Number: 1
Name: ''
Color: [0.9400 0.9400 0.9400]
Position: [680 678 560 420]
Units: 'pixels'
Show all properties
K>>
et cetera
  댓글 수: 2
Siva Ratnasingam
Siva Ratnasingam 2018년 5월 24일
Thanks for your reply
This happens when I run few code in a batch. Out of 10 codes one give the error.
When I run it individually, no problem.
per isakson
per isakson 2018년 5월 24일
편집: per isakson 2018년 5월 24일
Set
dbstop if error
start a batch and at the "break" (when the error is about to occur) inspect the input values of saveas

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

카테고리

Help CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by