Multiple plots not working on the simulink spring mass model
Ältere Kommentare anzeigen
In this pdf, page number 39, exericse 2 i tried implementing the same code using the same method but my output graph is like this. I have attachted my simulink file.
%for plotting graph
plot(out.t,out.x)
hold on
B = 8;
sim('second')
plot(out.t,out.x)
B=12;
sim('second')
plot(out.t,out.x)
B = 25;
sim('second')
plot(out.t,out.x)
hold off
%parameters
M=2; %kg
K= 16; %N/m
B=4; % Ns/m

Antworten (1)
Fangjun Jiang
am 2 Sep. 2021
0 Stimmen
4 Kommentare
R Abhinandan
am 2 Sep. 2021
Bearbeitet: R Abhinandan
am 2 Sep. 2021
Fangjun Jiang
am 2 Sep. 2021
That is my point. You changed the value of B but the output didn't seem to change.
Read this linked Q&A. Change your code sim('second') to dummy=sim('second') and try again.
R Abhinandan
am 2 Sep. 2021
Fangjun Jiang
am 2 Sep. 2021
Figure out what variable is your saved output. It could depend on your configuration setting, signal logging or ToWorkspace block.
Kategorien
Mehr zu Simulink 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!