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 Center および File ExchangeMATLAB についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by