What does this Error code mean ?

15 visualizzazioni (ultimi 30 giorni)
Siva Ratnasingam
Siva Ratnasingam il 24 Mag 2018
Modificato: per isakson il 24 Mag 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;

Risposte (1)

per isakson
per isakson il 24 Mag 2018
Modificato: per isakson il 24 Mag 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 Commenti
Siva Ratnasingam
Siva Ratnasingam il 24 Mag 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 il 24 Mag 2018
Modificato: per isakson il 24 Mag 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

Accedi per commentare.

Categorie

Scopri di più su Printing and Saving in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by