Effacer les filtres
Effacer les filtres

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

7 vues (au cours des 30 derniers jours)
Antonio Tartaglione
Antonio Tartaglione le 15 Oct 2018
Modifié(e) : Viren Gupta le 24 Oct 2018
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?

Réponses (1)

Viren Gupta
Viren Gupta le 24 Oct 2018
Modifié(e) : Viren Gupta le 24 Oct 2018
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

Catégories

En savoir plus sur Simulink Coder dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by