Varying input into a transfer function in simulink
Mostra commenti meno recenti
I want to vary a constant inside a transfer function in simulink. For example the transfer function could be: 1/(AS+1) where A is the varying constant. Then I want it to store the ouptut of each value in an array.
I tried doing this in Matlab with the following code:
G = zeros(10,2);
for i = 1:1:10
A = i;
out = sim('');
values1 = out.simout.values(:,1);
values2 = out.simout.values(:,2);
G = values2.*values1;
end
However, this code does not store every value of G that is calculated, and does not allow for A to be non integer values like i = 1:0.01:10.
Is there any way to do this?
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Simulink in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!