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 CenterFile Exchange에서 Dynamic System Models에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by