Why does the CLF function clear the error message identifier?

6 visualizzazioni (ultimi 30 giorni)
The CLF function clears the error message identifier returned by the LASTERR and LASTERROR functions.
ErrorState.message='error message';
ErrorState.identifier='error:identifier';
lasterror(ErrorState);
[msg,id] = lasterr
msg =
error message
id =
error:identifier
lasterror
ans =
message: 'error message'
identifier: 'error:identifier'
clf
[msg,id] = lasterr
msg =
error message
id =
lasterror
ans =
message: 'error message'
identifier: ''

Risposta accettata

MathWorks Support Team
MathWorks Support Team il 27 Giu 2009
This bug has been fixed in Release 14 Service Pack 2 (R14SP2). For previous releases, please read below for any possible workarounds:
We have verified that there is a bug in MATLAB 7.0 (R14), in that the CLF function will remove the error message identifier.
CLF calls GETAPPDATA which saves and restores the error message from LASTERR. To save the message id, replace LASTERR with LASTERROR, on lines 25 and 30 of getappdata.m:
On line 25:
la = lasterror;
On line 30:
lasterror(la);

Più risposte (0)

Categorie

Scopri di più su Platform and License in Help Center e File Exchange

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by