Pass input timeseries and block values into the sim command
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Yevgeniy Gorbachev
il 5 Feb 2023
Commentato: Yevgeniy Gorbachev
il 6 Feb 2023
Hi,
Is there a way to pass Simulink models inputs into the sim call as opposed to "From Workspace" blocks (for signals) or workspace-named variables (for mask parameters)?
e.g, instead of
V_in = timeseries(0:0.05:10 > 2, 0:0.05:10);
K = 10;
sim("my_simulation");
I would use something like
input_voltage = timeseries(0:0.05:10 > 2, 0:0.05:10);
motor_gain = 10;
sim("my_simulation", "V_in", input_voltage, "K", motor_gain); % (if I have blocks that expect things named V_in and K)
Thank you!
0 Commenti
Risposta accettata
Paul
il 5 Feb 2023
Hi Yevgeniy
Use a Simulink.SimulationInput object. More generally start from Run Simulations and follow the doc pages from there for more details.
Più risposte (0)
Vedere anche
Categorie
Scopri di più su General Applications in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!