How to solve the problem when using command h2syn design a H2 controller

16 views (last 30 days)
I'm trying to design a H2 controller for a feedback system, the MATLAB code as follow:
load('cz.mat');% loading the discrete impulse response of a system Ts=0.0005; %sampling rate:2k Num=cz'; Den=[1 zeros(1,length(Num)-1)]; G = tf(Num,Den,Ts);
load('WpDen80_400.mat'); load('WpNum80_400.mat'); Wp= tf(WpNum80_400,WpDen80_400,Ts); Wu=0.005; systemnames = ' G Wp Wu '; inputvar = '[ dist; control ]'; outputvar = '[ Wp; Wu; G+dist ]'; input_to_G = '[ control ]'; input_to_Wu = '[ control ]'; input_to_Wp = '[ G+dist ]'; sys_ic = sysic;
nmeas=1; ncon=1; [K2,CL2,GAM2,INF2]=h2syn(sys_ic, nmeas, ncon); After running, the error is: Error using - Matrix dimensions must agree.
Error in lti/h2syn (line 174) f2 = -d12'*c1 - f2c ; % f2 = -f2a

Answers (0)

Categories

Find more on Matrix Computations in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!