Internal Matlab function not found (isnan)

4 Ansichten (letzte 30 Tage)
Mark Anderson
Mark Anderson am 26 Mai 2022
Beantwortet: Star Strider am 26 Mai 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.

Antworten (2)

Star Strider
Star Strider am 26 Mai 2022
Try —
rehash toolboxcache
.

Jan
Jan am 26 Mai 2022
Try:
restoredefaultpath
  1 Kommentar
Mark Anderson
Mark Anderson am 26 Mai 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'.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Numeric Types 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