Unrecognized function or variable 'typeof'

8 visualizzazioni (ultimi 30 giorni)
I am getting a very weird error every once in a while, and it happens so randomly that I can't even really see a pattern to understand what causes this. I have a main code for a project which calls functions from different directories. I open Matlab and add the folders that my main code needs into my Matlab path, but sometimes Matlab gives an error sound after doing this (although the directory is actually added to the path) and then it gives the error in the screenshot I shared. After this, MATLAB practically becomes non-funtional: Command window works but I can't run any other m files, or I can't remove the folders I added from the path so I have to re-open MATLAB. I don't have any ways to reproduce this error because even if I don't make any changes, it sometimes starts working back after a couple of days.
Some of the folders are far away from the main code and I realized that sometimes it works to add these helper folders into the same directory my main m file lies in. I can do this if there is no solution to this but obviously this will require copying and pasting these folders any time I want to work on a new project.
I have seen one question about this unrecognized 'typeof' error but it didn't quite help my situation.
Has anyone ever encountered a similar error when trying to add directories into their paths? Any help is appreciated.
Thanks.

Risposta accettata

Steven Lord
Steven Lord il 13 Set 2020
You have downloaded or written an isa function that is shadowing (taking precedence over) the built-in isa function. Locate that shadowing isa.m and rename or remove the isa.m files that are not in a directory under matlabroot. Line 2 of that isa.m calls typeof which is not a function included in MATLAB.
which -all isa
  1 Commento
Hazar Benan Unal
Hazar Benan Unal il 13 Set 2020
Yes, problem solved! It turns out one of the toolboxes I installed has its own isa.m file and it was shadowing the built-in isa.m as you said. I renamed it and error is gone. Thank you very much.

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Environment and Settings in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by