command window does not recognize the functions in editor
29 visualizaciones (últimos 30 días)
Shubhangi Singh el 12 de Jul. de 2020
The two functions defined in editor and saved in C:\Users\SONY VAIO\Documemts\'function name'.
But when the function is called in command window it shows the error, Undefined Function. Neither can it recognize the variables used in the function. how should I so;ve the error?
John D'Errico el 12 de Jul. de 2020
I think you need to learn about the MATLAB search path.
While the editor can save a file anywhere you tell it to, when executing functions that you will create, MATLAB itself looks only in places you designate for that. Of course, it cannot search over your entire disk, as that would be far too large a place. That would make MATLAB run far too slowly. So you must tell MATLAB where to look for the files you wish to use.
The best way to do this is by using pathtool. It allows you to add a directory to your serch path. Don't forget to save the path, so the next time you open MATLAB, it will remmber that directory.