Building a Command line interface for MATLAB standalone application

I have an application written in MATLAB which needs to import some external data. I want to compile the program in order to build a standalone EXE file and I need a simple way to export some file names paths and some numbers to the application. I am thinking about some thing like command window or command line interface (NOT GUI). Do some body have any suggestions. Regards.

 採用された回答

Matt J
Matt J 2012 年 9 月 30 日

0 投票

Arguments can always be passed to a standalone from the command line. They will be interpreted as string arguments to the underlying mfile code. For example,
myEXE A B C
is equivalent to
myMFile('A','B','C'); %The source code for myEXE

5 件のコメント

Digitalsd
Digitalsd 2012 年 10 月 1 日
A is it a char or a string? The string data should be passed to a string variable in the m source code. Would you please show a small m source code example?
Matt J
Matt J 2012 年 10 月 1 日
Yes, whatever arguments you type at the command line will be passed as a string to the underlying mcode.
Compile the function below and at the command line type "test 1" without the quotes. It will print to the screen the result
y =
2
function test(A)
y=str2double(A)+1
Digitalsd
Digitalsd 2012 年 10 月 2 日
OK OK . Sub-Question: Is it possible to export the data to the application several times during the execution and How to print out a message for the user?
Matt J
Matt J 2012 年 10 月 2 日
編集済み: Matt J 2012 年 10 月 2 日
And you want to do this without commands like UIGETFILE,INPUTDLG, MSGBOX, etc...?
Digitalsd
Digitalsd 2012 年 10 月 2 日
Useful comment, Best Regards

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Community Treasure Hunt

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

Start Hunting!

Translated by