How to write my Matlab code so that its standalone application program takes multiple input files?

2 ビュー (過去 30 日間)
Dear All,
I want to design my standalone application code (.exe file generated by Matlab compiler) which takes input files as follows:
> Standalone_Code.exe <file1> <file2> <file3> <file4>
I am wondering if it is possible to write my Matlab code so that I can run its standalone applicaton code as the above.
Thanks a lot.
Benson

採用された回答

Matt J
Matt J 2020 年 6 月 17 日
編集済み: Matt J 2020 年 6 月 17 日
It should work just as you've shown. Just write your mcode to accept input arguments as you would write a non-deployed mfile. See also,
  2 件のコメント
Benson Gou
Benson Gou 2020 年 6 月 18 日
編集済み: Benson Gou 2020 年 6 月 18 日
Hi, Matt,
I wrote my Matlab code for the input files as follows:
fundction [x] = main(file1,file2,file3,file4)
.......
end
I have 4 txt files and their names are 'model.txt', 'meas1.txt', 'meas2.txt','meas3.txt'. I run my Matoab code as follows,
>> [x] = main('model.txt', 'meas1.txt', 'meas2.txt','meas3.txt')
it worked perfectly.
But after I obtained my standalone application using Compiler, I tried the following ways to read the input files:
  1. > main('model.txt', 'meas1.txt', 'meas2.txt','meas3.txt')
  2. > main 'model.txt', 'meas1.txt', 'meas2.txt','meas3.txt'
  3. > main <'model.txt'> <'meas1.txt>' <'meas2.txt'> <'meas3.txt'>
All of them did not work. Would you please tell me how it would work? Thanks a lot.
Benson
Benson Gou
Benson Gou 2020 年 6 月 18 日
Hi, Matt,
Now it works. I directly use the file names withou using ' '. Thanks a lot.
Benson

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB Compiler についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by