How to execute an application file by MATLAB command?
이전 댓글 표시
Dear User I have a application file(.exe extention) which for converting .pl4 extention to .mat extention that downloaded from: http://www.dsea.unipi.it/Members/ceraolow/Software... That file written in borland C++.
I need to execute it by MATLAB command, I know I should use "system('command')" function, but I do not know what command is needed. please help me. Regards
채택된 답변
추가 답변 (2개)
Mohsen
2013년 3월 21일
0 개 추천
댓글 수: 1
Jason Ross
2013년 3월 21일
The system() command will not interact with push buttons. If the executable requires this type of input you could probably use
system('Converter.exe')
which will then start the program, you can pick the files and then when it ends you will have control in MATLAB again.
Mohsen
2013년 3월 21일
0 개 추천
댓글 수: 4
Image Analyst
2013년 3월 21일
Jason told you twice now. Not sure what you're looking for, if that's not it. By the way, your Answer should really be a Comment since you're not answering your original question but commenting on Jason's answer. Please explain why Jason's answers do not meet your needs.
Jason Ross
2013년 3월 21일
Mohsen -- the system() command can be thought of as opening a command prompt. So if the program you are running can accept command line options, then you can pass those into your system prompt as I've already indicated. If the program can't take command line options, then the system command really won't help you -- but not because of any limitation of the system command, because the program doesn't support command line switches.
In other words, if you can't open a command shell and type something like this (and I'm completely making up these options)
converter.exe -convertfrom pl4 -convertto mat -infile myfile.pl4 -outfile myfile.mat
You won't be able to do this in automation.
If you have access to the source code, it's possible that you could add in the code to parse command line options, recompile it, then it would do what you would like.
Also, thanks, Image Analyst!
Mohsen
2013년 3월 21일
Jason Ross
2013년 3월 21일
If you want it to be done automatically using command line options, the conversion program itself must provide an interface MATLAB can use. MATLAB can access programs via a variety of interfaces, the command line is only one. You can also use COM, .NET or you can compile a .mex file.
The bottom line is that the conversion program needs to be modified to use an interface that allows automation. If the writer of the conversion program doesn't provide that interface, there is really nothing that MATLAB can do about it.
카테고리
도움말 센터 및 File Exchange에서 Data Type Conversion에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!