How to call dos commands from MATLAB command window?
이전 댓글 표시
I am trying to download SVN folder to my local copy, Using dos command
Output=dos(svn checkout /SVN Repository/ /Local Folder Path/)
which is not working, Any idea how to call dos command from MATLAB? Particularly I want to download SVN files without SVN dialogur box popup
답변 (2개)
Read the dos help page. The help explains how dos must be called, and it also gives lots of examples for your to try.
In your case you need to provide a string. Try this:
out = dos('svn checkout /SVN Repository/ /Local Folder Path/')
If this does not work then you need to give us the exact and complete error message or description of what happens.
SVN is built into MATLAB: Note that MATLAB has SVN built in, so it is not required to call DOS or do any other hacking around:
댓글 수: 8
Arun Badigannavar
2016년 7월 22일
Walter Roberson
2016년 7월 22일
None of the SVN clients for MS Windows appear to be named plain "svn". You need to install one of the following: https://en.wikipedia.org/wiki/Comparison_of_Subversion_clients
Or you can use the built-in svn calls if you have a new enough MATLAB.
Arun Badigannavar
2016년 7월 22일
Arun Badigannavar
2016년 7월 22일
@Arun Badigannavar: we understand what you want to do.
The error message tell us that svn is not recognized as name for whatever SVN client you are using. You need to find out why. This is a question of identifying the correct name for your SVN client, ensuring that the path is correct, or perhaps installing an appropriate client.
You need to find out how to call your SVN client correctly, or else install it.
Guillaume
2016년 7월 22일
@Walter, None of the SVN clients for MS Windows appear to be named plain "svn"
The 'official' subversion command line client is actually named plain svn (svn.exe).
Probably the easiest way to install that client is by installing TortoiseSVN. It may also come with Collabnet SVN or Visual SVN.
Arun Badigannavar
2016년 7월 22일
Walter Roberson
2016년 7월 22일
You need to manipulate the PATH environment variable within MATLAB so that the directory holding SVN is on the path. Use getenv() and setenv() for that.
Or since it is all by way of program, hard-code the path to the executable, like
SVN_CMD = 'C:\Programs (x86)\TortoiseSVN\x64\svn.exe';
SVN_reposit = '/SVN Repository';
local_folder = '/Local Folder Path/';
this_cmd = sprintf('"%s" checkout "%s" "%s"', SVM_CMD, SVN_reposit, local_folder);
system(this_cmd);
doc system...
system is used to call dos from MATLAB...
댓글 수: 1
Stephen23
2016년 7월 22일
According to the dos Mfile help: "This function is interchangeable with the SYSTEM and UNIX functions. They all have the same effect."
카테고리
도움말 센터 및 File Exchange에서 Downloads에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!