📄 ea_01.m
字号:
function ea_01;
%ea_01: seconda finestra della sintesi eig/assign
%
%Massimo Davini 17/04/2000
global stack;
%controllo sul numero di autovalori richiesti
campoedit=findobj('tag','ea0_edit');
num=str2num(get(campoedit,'string'));
if isempty(num)|(~isreal(num))|(num<1)|(num>size(stack.general.A,1))
set(campoedit,'string',num2str(size(stack.general.A,1)));
return;
end;
%tipo di feedback law
if get(findobj('tag','eaopt1'),'value') tipo=1; %state-feedback
elseif get(findobj('tag','eaopt2'),'value') tipo=2; %output-feedback
elseif get(findobj('tag','eaopt3'),'value') tipo=3; %constrained-feedback
end;
if tipo==2 ea_1;return;end; %output feedback
set(stack.temp.handles,'visible','off');
drawnow;
prec=length(stack.temp.handles);
st=.2;sf=.55;
if tipo==1 %state-feedback
Nota(1)=uicontrol('style','frame',...
'units','normalized','position',[0.1 0.29 0.8 0.58],...
'backgroundcolor',[1 1 1],'visible','off','tag','ea01');
str=['The STATE FEEDBACK controller Ksf ',...
'that you''ll design in this section, will be remapped',...
' into an OUTPUT FEEDBACK controller Kof, according to the law'];
Nota(2)=uicontrol('style','text','units',...
'normalized','position',[.13 .69 .74 0.15],...
'fontunits','normalized','fontsize',st,'fontweight','bold',...
'backgroundcolor',[1 1 1],'visible','off',...
'HorizontalAlignment','left','tag','ea01','string',str);
Nota(3)=uicontrol('style','text',...
'units','normalized','position',[.13 .58 .74 0.07],...
'fontunits','normalized','fontsize',sf,'fontweight','bold',...
'backgroundcolor',[1 1 1],'foregroundcolor',[1 0 0],...
'visible','off','HorizontalAlignment','center','tag','ea01',...
'string','Kof = Ksf * pinv( C - D*Ksf )');
Nota(4)=uicontrol('style','text',...
'units','normalized','position',[.13 .46 .74 0.1],...
'fontunits','normalized','fontsize',st,'fontweight','bold',...
'backgroundcolor',[1 1 1],'visible','off',...
'HorizontalAlignment','left','tag','ea01',...
'string',sprintf('then a real STATE FEEDBACK behaviour will be obtained when C = I and D = 0 .'));
Nota(5)=uicontrol('style','text',...
'units','normalized','position',[.13 .32 .74 0.1],...
'fontunits','normalized','fontsize',st+.1,...
'backgroundcolor',[1 1 1],'visible','off','foregroundcolor',[0 0 1],...
'HorizontalAlignment','left','tag','ea01',...
'fontweight','bold',...
'string','Note : in order to set the matrices C = I and D = 0 you can use the Tools menu in the Modeling section.');
stack.temp.handles=[stack.temp.handles,Nota];
elseif tipo==3
Nota(1)=uicontrol('style','text','units',...
'normalized','position',[.05 .87 .9 0.05],...
'fontunits','normalized','fontsize',.8,'fontweight','bold',...
'backgroundcolor',[.6 .7 .9],'visible','off',...
'HorizontalAlignment','left','tag','ea01',...
'string','CONSTRAINT MATRIX with size (#Inputs,#Outputs)');
drawnow;
KVIN=NaN*ones(size(stack.general.B,2),size(stack.general.C,1));
[row column]=size(KVIN);
for i=1:row ,for j=1:column
if (column>4)
lar=(0.9-0.02*(column-1))/column;
pos=[.05+(lar+0.02)*(j-1) .85-i*.065 lar .055];
else
pos=[.05+0.12*(j-1) .85-i*.065 .1 .055];
end;
str=num2str(KVIN(i,j));
coeff(i,j)=uicontrol('style','edit','units','normalized',...
'position',pos,'tag','mat','string',str,...
'fontunits','normalized','fontsize',0.6,'fontweight','bold',...
'Horizontalalignment','left','backgroundcolor',[1 1 1]);
end ,end;
Nota(2)=uicontrol('style','text','units',...
'normalized','position',[.36 .03 .43 0.14],...
'fontunits','normalized','fontsize',.2857,'fontweight','bold',...
'backgroundcolor',[.6 .7 .9],'visible','off',...
'HorizontalAlignment','left','tag','ea01',...
'string','Insert the contraints of the output feedback matrix as fixed zeros.');
stack.temp.handles=[stack.temp.handles,Nota];
for i=1:row, stack.temp.handles=[stack.temp.handles,coeff(i,:)];end;
end;
ea(1)=uicontrol('style','push','unit','normalized','position',[0.05 0.05 0.14 0.12],...
'fontunits','normalized','fontsize',.35,'fontweight','bold',...
'string','BACK','Horizontalalignment','center','tag','ea01',...
'TooltipString','Back to the previous window',...
'callback',sprintf('back_syn(''ea0'',%u);',prec));
ea(2)=uicontrol('style','push','unit','normalized','position',[0.2 0.05 0.14 0.12],...
'fontunits','normalized','fontsize',.35,'fontweight','bold',...
'string','CLOSE','Horizontalalignment','center','tag','ea01',...
'TooltipString','Back to the main SYNTHESIS window',...
'callback','back_syn(''syn0'',0);');
ea(3)=uicontrol('style','push','unit','normalized','position',[0.81 0.05 0.14 0.12],...
'fontunits','normalized','fontsize',.35,'fontweight','bold',...
'Horizontalalignment','center','string','NEXT','tag','ea01',...
'TooltipString','Go to the next window','callback','ea_1;');
set(findobj('tag','ea01'),'visible','on');
%aggiornamento handles temporanei
stack.temp.handles=[stack.temp.handles,ea];
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -