Internal Matlab function not found (isnan)

4 vues (au cours des 30 derniers jours)
Mark Anderson
Mark Anderson le 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.

Réponses (2)

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

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

Connectez-vous pour commenter.

Catégories

En savoir plus sur Numeric Types dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by