Why custom function in path are not found anymore?
7 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Alessandro Cernicchi
el 6 de Nov. de 2015
Comentada: Alessandro Cernicchi
el 6 de Nov. de 2015
I use matlab R2009b on windows 7 64-bit. I've been using it since 2009 with no troubles, now all the functions I defined in the past do not work anymore. To give an example:
I use often a function called "readdls9000" which is in C:\matlab folder
when I type
path
on prompt line the output is:
MATLABPATH
C:\matlab
C:\Users\cernicca\Documents\MATLAB
C:\Program Files\MATLAB\R2009b\toolbox\matlab\general
C:\Program Files\MATLAB\R2009b\toolbox\matlab\ops
C:\Program Files\MATLAB\R2009b\toolbox\matlab\lang
C:\Program Files\MATLAB\R2009b\toolbox\matlab\elmat
C:\Program Files\MATLAB\R2009b\toolbox\matlab\randfun
C:\Program Files\MATLAB\R2009b\toolbox\matlab\elfun
C:\Program Files\MATLAB\R2009b\toolbox\matlab\specfun
C:\Program Files\MATLAB\R2009b\toolbox\matlab\matfun
C:\Program Files\MATLAB\R2009b\toolbox\matlab\datafun
...
if I type
which readdls9000
the output is
C:\matlab\readdls9000.m % Has no license available
therefore the function is recognized by Matlab. However if I try to call it from prompt line or from a routine I get this:
>> readdls9000
??? Undefined function or variable 'readdls9000'.
This was just an example the same goes for any function that I wrote, which is in a folder added to Matlab path.
0 comentarios
Respuesta aceptada
Thorsten
el 6 de Nov. de 2015
Editada: Thorsten
el 6 de Nov. de 2015
The hint is the string
% Has no license available
when you type which. This tells you that the file is there, put that the license to use it is missing. This can occur even for function that you wrote yourself, if there is a single function in the directory that has the same name as a function in a Matlab toolbox.
I found the following answer here ( http://www.mathworks.com/matlabcentral/newsreader/view_thread/163027 ):
This issue occurs because one or more of the MATLAB files in this folder have the same name as a MATLAB function which is in a toolbox that you are not licensed for. This conflict occurs for certain specific functions. For example, suppose you have a MATLAB file called 'hamming.m' and do not have the Signal Processing Toolbox.
You will receive the same output for all MATLAB files located in the same folder as 'hamming.m' and will be unable to run any files in this directory. To work around the issue, rename the conflicting MATLAB file. In this case change the name of 'hamming.m'.
So probably you have recently added a function to your folder that has the same name as a function in a Matlab toolbox.
Más respuestas (0)
Ver también
Categorías
Más información sobre Startup and Shutdown en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!