function name

4 次查看(过去 30 天)
Richard
Richard 2012-3-5
Why is it that a function does not work with some names? e.g. I named one of my functions magnuson(PathName) and the function would not work, it would return an error saying:
Undefined function 'magnuson' for input arguments of type 'char'.
Then after changing the name of the function to magnuson_LA(PathName) it worked perfectly. Why is this?

采纳的回答

Oleg Komarov
Oleg Komarov 2012-3-5
Usually that error comes when the function has been saved on path that MATLAB cannot reach.
Matlab checks for functions in the current directory and a saved list of paths.
To add a path to the search:
addpath('C:\...\')
I would recommend to read this guide: Making Files and Folders Accessible to MATLAB

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Search Path 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by