Control System with Feedback Loop

3 ビュー (過去 30 日間)
Esin Derin
Esin Derin 2022 年 6 月 25 日
回答済み: Sam Chak 2022 年 6 月 25 日
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

採用された回答

Sam Chak
Sam Chak 2022 年 6 月 25 日
It can be very frustrating when one is not familiar with the MATLAB coding + Loop, and pressurized to complete the Lab report. When I look into the task, it does not require you to use Looping. Thus, I'd suggest you do something very simple like this to get very comfortable at modeling. Record the Scope output and paste it into your lab report. When you have free time later, slowly explore the program and additional features that you are interested in.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDynamic System Models についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by