What does this Error code mean ?

20 vues (au cours des 30 derniers jours)
Siva Ratnasingam
Siva Ratnasingam le 24 Mai 2018
Modifié(e) : per isakson le 24 Mai 2018
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;

Réponses (1)

per isakson
per isakson le 24 Mai 2018
Modifié(e) : per isakson le 24 Mai 2018
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 commentaires
Siva Ratnasingam
Siva Ratnasingam le 24 Mai 2018
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 le 24 Mai 2018
Modifié(e) : per isakson le 24 Mai 2018
Set
dbstop if error
start a batch and at the "break" (when the error is about to occur) inspect the input values of saveas

Connectez-vous pour commenter.

Catégories

En savoir plus sur MATLAB dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by