How to resolve the error while using the 'findall' function?

7 ビュー (過去 30 日間)
MathWorks Support Team
MathWorks Support Team 2020 年 10 月 13 日
編集済み: MathWorks Support Team 2022 年 7 月 22 日
I am facing the following error message when using the 'findall' function:
Unrecognized function or variable 'findall'
or
Unrecognized function or variable 'findall'.
Error in matlab.ui.internal.legacyMoveGUI (line 30)
haveMenubar = ~isempty(findall(fig,'type','uimenu'));
Error in movegui (line 125)
matlab.ui.internal.legacyMoveGUI(fig, position);
Error in msgbox (line 388)
movegui(figureHandle)
Error in errordlg (line 59)
handle = msgbox(ErrorStringCell,dlgName,'error',replace);
Error in uiopen (line 202)
errordlg(err);
How can I resolve the above error message?

採用された回答

MathWorks Support Team
MathWorks Support Team 2022 年 7 月 22 日
編集済み: MathWorks Support Team 2022 年 7 月 22 日
These types of issues happen due to path issues and also when the cache is not up to date. The following steps will help resolve this issue. 
Before modifying the search path, it is important to take a backup of your 'pathdef.m' file, which can be located by using the following command. Ensure that the copy is placed in a folder outside of the MATLAB path.
>> which -all pathdef
After taking the backup, please execute the following commands in the MATLAB Command Window to restore the default MATLAB search path and rehash the toolbox cache:
>> restoredefaultpath
>> rehash toolboxcache
>> sl_refresh_customizations 
After this step, please use MATLAB/ Simulink to see if the issue occurs again. If the issue is resolved, then you may want to save the new MATLAB search path by executing the following command:
>> savepath
NOTE: This will remove any custom paths you may have created.
The following MATLAB Answers post is an additional resource on how to back them up:

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeStartup and Shutdown についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by