Control System with Feedback Loop
Ältere Kommentare anzeigen
I'm trying to connect Simulink with Matlab codes but always get unable to load block diagram error. And I can't get gain and time constant from scope 2.If you could help, it would be wonderful.
%Feedback Loop
TransferF1=tf([4],[5 1]);
TransferF1=tf([4],[5 1]);
%Feedback Loop with different Frequinces
G=tf([4],[5 1]);
K=0;
Gcl=G/[1+K*G];
K1=5;
Gcl1=G/[1+K1*G];
K2=-1;
Gcl2=G/[1+K2*G];
K3=-0.5;
Gcl3=G/[1+K3*G];
ltiview('bode',Gcl,Gcl1,Gcl2,Gcl3)
freqvec = [0.1 0.2 0.4]; % choose whatever frequencies are needed
for ii = 1:numel(freqvec)
freqHz = freqvec(ii);
out = sim('kontrollab2diagram'); % use the actual name of the .slx file
% do whatever processing is needed on out
end
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Tuning Goals 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!

