How to transfer a .m file in another folder
2 次查看(过去 30 天)
显示 更早的评论
Hello everyone!
I've got one simple question (yet I struggle to get through it) : I'm working with .m files that requires themselves others .m files functions to work. So, everything is in a folder A and it's working great. But if I create a folder B inside of A, and put every scripts on B, it doesn't work anymore. And yes, I've changed the "current folder" to B before starting those scripts. I can't find any solutions to this problem. I'd be grateful if someone could help! :)
Thanks in advance!
0 个评论
回答(1 个)
Walter Roberson
2019-3-29
Add folder B to the MATLAB path. You will not need to cd to there.
3 个评论
Stephen23
2019-3-29
编辑:Stephen23
2019-3-31
The search path is simply a list of directories where MATLAB will look for functions:https://www.mathworks.com/help/matlab/matlab_env/what-is-the-matlab-search-path.html
You can add directories to the search path using the interactive tools from the main menu:
or using addpath:
For a more detailed discussion on the MATLAB search path:
另请参阅
类别
在 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!