matlab can't open m file

2 Ansichten (letzte 30 Tage)
Ramadhan
Ramadhan am 6 Aug. 2018
Kommentiert: Stephen23 am 6 Aug. 2018
If I try opening a file or script by clicking on it from the command window, I get the following error:

Antworten (1)

Jan
Jan am 6 Aug. 2018
Bearbeitet: Jan am 6 Aug. 2018
It seems like you have redefined the function length and store it in a folder, which is saved on top of the path.
The solution is to avoid using the names of the built-in functions for user-defined functions. To reduce such collision, move the folder containing user-defined functions to the bottom of the path, such that the built-in functions are preferred.
Maybe this tool helps you to check the names of your M-files for collisions: FileExchange: UniqueFunNames
Your matlabrc function shows warnings during the startup of Matlab already. Because this runs before the path is included, you might have destroyed your Matlab installation. If cleaning up the path does not help, a re-installation of Matlab might be required.
  1 Kommentar
Stephen23
Stephen23 am 6 Aug. 2018
"The solution is to avoid using the names of the built-in functions for user-defined functions"
The function which should be used before defining any variable name or function name:
which length -all

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Startup and Shutdown finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by