Why do I get the error "Undefined function or variable 'onCleanup'"?

14 Ansichten (letzte 30 Tage)
Fabio Borza
Fabio Borza am 30 Mai 2017
Beantwortet: Jan am 30 Mai 2017
Hi everybody. Opening programs I get this error:
Undefined function or variable 'onCleanup'.
Error in getnicedialoglocation (line 21)
c = onCleanup(@() close(convertData.hFig));
Error in msgbox (line 324)
DefFigPos = getnicedialoglocation(DefFigPos, get(figureHandle,'Units'));
Error in errordlg (line 47)
handle = msgbox(ErrorStringCell,DlgName,'error',Replace);
Error in uiopen (line 194)
errordlg(err);
What can I do to solve the problem and start using Matlab again?

Antworten (2)

ES
ES am 30 Mai 2017
Something is wrong with your path.
onCleanUp resides here. It should be visible on startup.
{MATLAB Installation Directory}\toolbox\matlab\general\onCleanup.m
Try
which onCleanup
restoredefaultpath
commands

Jan
Jan am 30 Mai 2017
The first point to start is asking the docs about this function. In the current version found on the MathWorks pages (and found by Google):
There it is mentioned, that the function was "Introduced in R2008a". Do you run an older version? Then it would be useful, if you mention this.

Kategorien

Mehr zu Startup and Shutdown finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by