How can I change a parameter in a Simulink block using code setVariable?
Ältere Kommentare anzeigen
I do a simply circuit simulation, a voltage source DC and a resistence, i create 2 variables A = amplitude DC source and R = resistance, when try change this variables ony change A but R not change in the block so the out is not the rigth.
I do this
In = Simulink.SimulationInput('Sim');
In = In.setVariable('A',10);
In = In.setVariable('R',20);
In = simulink.compiler.configureForDeployment(In); % I need this
out = sim(In);
2 Kommentare
Rhea Chandy
am 4 Feb. 2021
From what I understand, you're trying to update the variables 'A' and 'R' programmatically, but the variable R is not updating as expected. Can you share the model you're working on so that I can recreate the issue and investigate further?
Carlos Santiago Moreno Lozano
am 5 Feb. 2021
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Foundation and Custom Domains finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!