Script does not use local path?

조회 수: 5 (최근 30일)
Brian
Brian 2015년 12월 17일
편집: Adam 2015년 12월 18일
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.
  1. Is this an expected behavior?
  2. How do I implement this concept of release / debug?
  3. 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

답변 (2개)

Adam
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
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).
Jordan Brouns
Jordan Brouns 2015년 12월 18일
You can add any folder in the matlab path

댓글을 달려면 로그인하십시오.


Image Analyst
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

카테고리

Help CenterFile Exchange에서 Source Control Integration에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by