Passing command-line arguments to a standalone simulink executable

9 ビュー (過去 30 日間)
Sunny SNT
Sunny SNT 2012 年 10 月 9 日
回答済み: Anuj Patil 2019 年 5 月 30 日
Hi,
I have been trying to generate a standalone executable from a simulink model using Real time workshop (R2011a). I'm able to generate an exe which does not have any external interface. Now, I have a requirement to make it paramterised and accept a command-line argument as one of the inputs. I have tried using an input port at the top-level model but I'm not sure whether that would actually work. There is a configuration setting for generating C API under code generation settings (Simulation > Configuration Parameters > Code Generation > Interface > Data exchange) but I haven't been able to figure out whether it can be used. I was wondering if anyone of you has tried implementing this. Any help would be greatly appreciated.
Thank you,
  2 件のコメント
Ketan
Ketan 2012 年 10 月 10 日
Hi Sunny,
What are you trying to parameterize within your model? For example, are you trying to control a block parameter value (IE the gain value of a gain block) or control input data that is used for the model?
CALEB
CALEB 2014 年 7 月 9 日
Has there been any answer on Matlab Central to this question? I can find no material on this topic, but I have the same question, as I'm trying to use code generated by Simulink Coder and pass command line arguments to it. I have a trivial model with one input wired to the output, but after building it (no data exchange interface set, but MAT-file logging on) and running at the command line the input (In1... simulink defaults) is clearly not accepting my command line inputs. I've tried the following syntax to no avail:
>> myCode
>> myCode argVal
>> myCode In1 argVal
>> myCode -In1 argVal

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

回答 (1 件)

Anuj Patil
Anuj Patil 2019 年 5 月 30 日
https://in.mathworks.com/help/compiler/working-with-standalone-applications-and-arguments.html
This should be helpful.

カテゴリ

Help Center および File ExchangeDeployment, Integration, and Supported Hardware についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by