How to pass inputs to a Simulink executable launched in the cmd

조회 수: 3 (최근 30일)
Antonio Tartaglione
Antonio Tartaglione 2018년 10월 15일
편집: Viren Gupta 2018년 10월 24일
Hi everyone, I have a simple Simulink model consisting in a simple sum beetwen two inputs. I created, by using Simulink coder, the executable of this model and I want to launch it in the cmd by using a file Excel containing the two inputs of the sum. As output I want the result of the sum. Is it possible?

답변 (1개)

Viren Gupta
Viren Gupta 2018년 10월 24일
편집: Viren Gupta 2018년 10월 24일
If you have used rsim target, then you can follow the approach mentioned in the below link to add input arguments. https://www.mathworks.com/help/rtw/ug/rapid-simulations.html#brdeu57
1) Build the model with rsim.tlc as system target file
2) Collect parameters structure
>> param_struct = rsimgetrtp('myModel');
>> save myParams.mat param_struct;
3) If you wish to specify different input arguments:
>> param_struct = rsimsetrtpparam(param_struct,2);
>> param_struct.parameters{2}.values = [2 3];
>> save mymatfile.mat param_struct;
>> !myModel -p mymatfile.mat@2 -o rsim2.mat

카테고리

Help CenterFile Exchange에서 Multicore Processor Targets에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by