How to add a function to MATLAB root
3 次查看(过去 30 天)
显示 更早的评论
Hi,
I would like to use a function I created in other routines without having to put it in the same folder (by simply using my_function()). Is this possible? Can I put the function archive in some MATLAB root folder for this? If yes, which folder?
Thanks.
0 个评论
采纳的回答
Geoff
2012-4-4
Just keep it in your own 'handy stuff' directory or whatever, and add that to MatLab's path.
File -> Set Path...
Don't forget to save changes.
This also makes it easier to find if you ever want to give code to someone else... "Oh yeah, I have a handy function to do that"
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 File Operations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!