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

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?

답변 (2개)

ES
ES 2017년 5월 30일
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 2017년 5월 30일

0 개 추천

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.

카테고리

도움말 센터File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

질문:

2017년 5월 30일

답변:

Jan
2017년 5월 30일

Community Treasure Hunt

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

Start Hunting!

Translated by