Internal Matlab function not found (isnan)

10 views (last 30 days)
Mark Anderson
Mark Anderson on 26 May 2022
Answered: Star Strider on 26 May 2022
From the command window (but also in scripts) I get the following.
K>> ans = isnan(bSteadyX);
'isnan' is not found in the current folder or on the MATLAB path, but exists in:
/Applications/MATLAB_R2022a.app/toolbox/matlab/elmat
Change the MATLAB current folder or add its folder to the MATLAB path.
K>> addpath '/Applications/MATLAB_R2022a.app/toolbox/matlab/elmat'
K>> ans = isnan(bSteadyX);
'isnan' is not found in the current folder or on the MATLAB path, but exists in:
/Applications/MATLAB_R2022a.app/toolbox/matlab/elmat
Change the MATLAB current folder or add its folder to the MATLAB path.
K>> cd '/Applications/MATLAB_R2022a.app/toolbox/matlab/elmat'
K>> ans = isnan(bSteadyX);
Unrecognized function or variable 'isnan'.
But if run the live script provided in the help documents ...
Replace NaN Elements
Create an array and find the elements with NaN values.
A = [1,3,5,7,NaN,10,NaN,4,6,8]
A = 1×10
1 3 5 7 NaN 10 NaN 4 6 8
TF = isnan(A)
TF = 1×10 logical array
0 0 0 0 1 0 1 0 0 0
So isnan works just fine from a live script but not from the command window.

Answers (2)

Star Strider
Star Strider on 26 May 2022
Try —
rehash toolboxcache
.

Jan
Jan on 26 May 2022
Try:
restoredefaultpath
  1 Comment
Mark Anderson
Mark Anderson on 26 May 2022
No Joy ...
K>> ans = isnan(bSteadyX);
'isnan' is not found in the current folder or on the MATLAB path, but exists in:
/Applications/MATLAB_R2022a.app/toolbox/matlab/elmat
Change the MATLAB current folder or add its folder to the MATLAB path.
K>> restoredefaultpath
K>> ans = isnan(bSteadyX);
'isnan' is not found in the current folder or on the MATLAB path, but exists in:
/Applications/MATLAB_R2022a.app/toolbox/matlab/elmat
Change the MATLAB current folder or add its folder to the MATLAB path.
K>> cd '/Applications/MATLAB_R2022a.app/toolbox/matlab/elmat'
K>> ans = isnan(bSteadyX);
Unrecognized function or variable 'isnan'.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!