input_callback.m
上传用户:jspk663
上传日期:2013-08-19
资源大小:232k
文件大小:2k
- function input_callback()
- %%%%%%%%%%%%%%%%%%%%%
- % defaut parameters %
- %%%%%%%%%%%%%%%%%%%%%
- A=[1 0
- 0 1]; %Φ(k+1,k)
- B=[.1 .3
- .2 .2]; %Γ(k+1,k)
- H=[.1 2
- .3 .4]; %H(k)
- Q=[.2 .1
- .1 .4]; %Q(k)
- R=[.1 .05
- .05 .1]; %R(k)
- P0=[.1 0
- 0 .4]; %P(0)
- X0=[0 0]'; %X(0,0)
- %%%%%%%%%%%%%%
- % inpudialog %
- %%%%%%%%%%%%%%
- prompt={'Φ(k+1,k):(n×n)','Γ(k+1,k):(n×p)','H(k):(m×n)','Q(k):(p×p)','R(k):(m×m)',...
- 'P(0):(n×n)','X(0,0):(n×1)'};
- title='Input Parameters';
- lines=[2 2 2 2 2 2 2];
- def={num2str(A),num2str(B),num2str(H),num2str(Q),num2str(R),num2str(P0),...
- num2str(X0)};
- answer=inputdlg(prompt,title,lines,def);
- if isempty(answer)
- return
- end
- %%%%%%%%%%%%%%%%%%%
- % save parameters %
- %%%%%%%%%%%%%%%%%%%
- exist=0;
- if ~isempty(answer{1})
- A=str2num(answer{1});
- if exist
- save inidata A -append;
- else
- save inidata A;
- exist=1;
- end
- end
- if ~isempty(answer{2})
- B=str2num(answer{2});
- if exist
- save inidata B -append;
- else
- save inidata B;
- exist=1;
- end
- end
- if ~isempty(answer{3})
- H=str2num(answer{3});
- if exist
- save inidata H -append;
- else
- save inidata H;
- exist=1;
- end
- end
- if ~isempty(answer{4})
- Q=str2num(answer{4});
- if exist
- save inidata Q -append;
- else
- save inidata Q;
- exist=1;
- end
- end
- if ~isempty(answer{5})
- R=str2num(answer{5});
- if exist
- save inidata R -append;
- else
- save inidata R;
- exist=1;
- end
- end
- if ~isempty(answer{6})
- P0=str2num(answer{6});
- if exist
- save inidata P0 -append;
- else
- save inidata P0;
- exist=1;
- end
- end
- if ~isempty(answer{7})
- X0=str2num(answer{7});
- if exist
- save inidata X0 -append;
- else
- save inidata X0;
- exist=1;
- end
- end
- CI=findobj(gcf,'tag','compo1');
- set(CI,'userdata',[]);
- generatezk;