I have some MATLAB functions defined in .m files and I'd like to import them into MATLAB (as in I'd like to be able to call them as I do a built-in function). How can I do this?
相关问题
- Extract matrix elements using a vector of column i
- Keeping track of variable instances
- What is the best way to do a search in a large fil
- How to get the maximum of more than 2 numbers in V
- F#: Storing and mapping a list of functions
相关文章
- What is the correct way to declare and use a FILE
- Making new files automatically executable?
- Accessing an array element when returning from a f
- How do I append metadata to an image in Matlab?
- Equivalent to window.setTimeout() for C++
- How to serialize data into indented json [duplicat
- How can I write-protect the Matlab language?
- Java Equivalent to iif function
You should be able to put them in your ~/matlab on unix.
I'm not sure which directory matlab looks in for windows, but you should be able to figure it out by executing
userpath
from the matlab command line.If the folder just contains functions then adding the folders to the path at the start of the script will suffice.
If they are Packages, folders starting with a '+' then they also need to be imported.
You need to add the package folders parent to the search path.
Solution for Windows
Go to File --> Set Path and add the folder containing the functions as Matlab files. (At least for Matlab 2007b on Vista)
You have to set the path. See here.