Script does not use local path?
3 次查看(过去 30 天)
显示 更早的评论
I store code that I want all applications to share by releasing into a C:My Documents\Matlab directory. I work on it in a local directory to debug it and then copy it to this release directory, analogous to a \usr\bin directory. This is a poor man's code revision system.
I ran a script that was in the C:My Documents\Matlab directory. It used the version in C:My Documents\Matlab not the copy in the local directory. It seems that scripts choose the script / class that is local to their own directory rather than the directory of the path in the GUI.
- Is this an expected behavior?
- How do I implement this concept of release / debug?
- I could install TortiseSVN, Apache Subversion, or some other code revision control system. Is this the best way or is there another way or a product that works better with Matlab
0 个评论
回答(2 个)
Adam
2015-12-17
编辑:Adam
2015-12-18
Your path is defined within Matlab and is just taken in the order things appear on the path, unless code is in a private folder in which case I think that is picked up before any other identically named functions elsewhere on your path. It doesn't matter where on disk code sits, so long as it is on the path. Having two copies of functions on your path is a lot of micro-management though if you have to keep switching them around. I would not recommend that as it is too easy to get it wrong.
Just type
path
to see your path or follow links at the bottom of
doc path
doc addpath
etc to see how you can manipulate your path. Usually I do it through the interface on the Matlab Home tab though.
3 个评论
Adam
2015-12-18
I'm not sure what you mean by 'local' path. As far as I'm aware there is just one path (for Matlab files).
Image Analyst
2015-12-18
Perhaps your current folder was actually the release folder instead of the working/test folder like you thought. If that's definitely not the case, then go to the Home tab on the tool ribbon and click setpath. You'll see the order of the search path. You will see that your release folder will be higher in the list than your test/working folder. There are buttons to move folders up and down in the priority list.
I also have a work folder. When I'm done and want to make an official copy I copy my files to a release folder and then "Commit" these files to the repository on the network shared drive with Tortoise Subversion.
MATLAB now has Subversion version control integrated into MATLAB. See this link: http://www.mathworks.com/help/matlab/matlab_prog/set-up-svn-source-control.html?s_tid=srchtitle
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Source Control Integration 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!