How to execute an application file by MATLAB command?

조회 수: 4 (최근 30일)
Mohsen
Mohsen 2013년 3월 21일
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

채택된 답변

Jason Ross
Jason Ross 2013년 3월 21일
The link you included is invalid, but to run an executable with the system command, you do the following:
[status,result] = system('myexecutable.exe -option1 -option2')
where
  • myexecutable.exe is the name of the executable. You might need to include the full path to the executable if it's not on your path by default.
  • -option1 and -option2 are the parameters you pass into the executable. These could also be filenames.
  • status is the exit status of the executable (did it exit normally or not)
  • result has any output

추가 답변 (2개)

Mohsen
Mohsen 2013년 3월 21일
First of all Thank You, this application file has a pushbutton and need to determine input and output extention and I do not know how to detemine. here there is valid link for getting the file : https://hotfile.com/dl/199239588/f5947d2/Converter.exe.html
Please guide me for determining "command" term.
Thank you again.
  댓글 수: 1
Jason Ross
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
Mohsen 2013년 3월 21일
Dear friend, Because of very iterations, I would like all steps be performed by MATLAB then How do I pick the files in command line? Thank you all!
  댓글 수: 4
Mohsen
Mohsen 2013년 3월 21일
By system('Converter.exe') you only can open the file, but selecting and converting pl4 file to mat file may be performed manually. I would like all steps be performed by MATLAB commands. In other words please guide me for converting .pl4 extention to .mat extention by command line. Jason mentioned: " you can pick the files" that is performed manually.
Jason Ross
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.

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

카테고리

Help CenterFile Exchange에서 COM Component Integration에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by