資源簡介
兩級倒立擺仿真模型的GUI控制界面-The GUI of double inverted pendulum simulation system.rar
??這是我近幾天做的一個GUI界面,用于control the simulation model of the double inverted pendulum system.里面有我的基于GA尋優后的LQR控制的兩級倒立擺仿真模型(不包括ga尋優的m文件),以及SimulateGUIhanhan.m和SimulateGUIhanhan.fig文件。不知道做類似gui的同學們有沒這樣的問題:就是在gui對應的m文件中(我有guide 創建的gui)如果使用sim函數進行模型的仿真,即使你在scope模塊中設定將array形式的輸出save to workspace,或者利用時鐘和輸出端子,再或者利用to workspace,輸出參數都保存不到工作空間。為了解決這個問題,我問過math老師,最后采用:to flie的形式將.mat文件保存,然后在程序中download一下就ok了呵呵!
? ?現在我將我近期做的這個小東西拿來給大家分享一下呵呵!
? ?? ?我不怎會傳圖片就一同放在附件里了呵呵!
fig.jpg
mdl.jpg
??這是我近幾天做的一個GUI界面,用于control the simulation model of the double inverted pendulum system.里面有我的基于GA尋優后的LQR控制的兩級倒立擺仿真模型(不包括ga尋優的m文件),以及SimulateGUIhanhan.m和SimulateGUIhanhan.fig文件。不知道做類似gui的同學們有沒這樣的問題:就是在gui對應的m文件中(我有guide 創建的gui)如果使用sim函數進行模型的仿真,即使你在scope模塊中設定將array形式的輸出save to workspace,或者利用時鐘和輸出端子,再或者利用to workspace,輸出參數都保存不到工作空間。為了解決這個問題,我問過math老師,最后采用:to flie的形式將.mat文件保存,然后在程序中download一下就ok了呵呵!
? ?現在我將我近期做的這個小東西拿來給大家分享一下呵呵!
? ?? ?我不怎會傳圖片就一同放在附件里了呵呵!
fig.jpg
mdl.jpg

代碼片段和文件信息
function?varargout?=?SimulateGUIhanhan(varargin)
%?SIMULATEGUIHANHAN?M-file?for?SimulateGUIhanhan.fig
%??????SIMULATEGUIHANHAN?by?itself?creates?a?new?SIMULATEGUIHANHAN?or?raises?the?existing
%??????singleton*.
%
%??????H?=?SIMULATEGUIHANHAN?returns?the?handle?to?a?new?SIMULATEGUIHANHAN?or?the?handle?to
%??????the?existing?singleton*.
%
%??????SIMULATEGUIHANHAN(‘CALLBACK‘hobjecteventDatahandles...)?calls?the?local
%??????function?named?CALLBACK?in?SIMULATEGUIHANHAN.M?with?the?given?input?arguments.
%
%??????SIMULATEGUIHANHAN(‘Property‘‘Value‘...)?creates?a?new?SIMULATEGUIHANHAN?or?raises?the
%??????existing?singleton*.??Starting?from?the?left?property?value?pairs?are
%??????applied?to?the?GUI?before?SimulateGUIhanhan_OpeningFcn?gets?called.??An
%??????unrecognized?property?name?or?invalid?value?makes?property?application
%??????stop.??All?inputs?are?passed?to?SimulateGUIhanhan_OpeningFcn?via?varargin.
%
%??????*See?GUI?Options?on?GUIDE‘s?Tools?menu.??Choose?“GUI?allows?only?one
%??????instance?to?run?(singleton)“.
%
%?See?also:?GUIDE?GUIDATA?GUIHANDLES
%?Edit?the?above?text?to?modify?the?response?to?help?SimulateGUIhanhan
%?Last?Modified?by?GUIDE?v2.5?09-Sep-2010?17:00:55
%?Begin?initialization?code?-?DO?NOT?EDIT
gui_Singleton?=?1;
gui_State?=?struct(‘gui_Name‘???????mfilename?...
???????????????????‘gui_Singleton‘??gui_Singleton?...
???????????????????‘gui_OpeningFcn‘?@SimulateGUIhanhan_OpeningFcn?...
???????????????????‘gui_OutputFcn‘??@SimulateGUIhanhan_OutputFcn?...
???????????????????‘gui_LayoutFcn‘??[]??...
???????????????????‘gui_Callback‘???[]);
if?nargin?&&?ischar(varargin{1})
????gui_State.gui_Callback?=?str2func(varargin{1});
end
if?nargout
????[varargout{1:nargout}]?=?gui_mainfcn(gui_State?varargin{:});
else
????gui_mainfcn(gui_State?varargin{:});
end
%?End?initialization?code?-?DO?NOT?EDIT
%?---?Executes?just?before?SimulateGUIhanhan?is?made?visible.
function?SimulateGUIhanhan_OpeningFcn(hobject?eventdata?handles?varargin)
%?This?function?has?no?output?args?see?OutputFcn.
%?hobject????handle?to?figure
%?eventdata??reserved?-?to?be?defined?in?a?future?version?of?MATLAB
%?handles????structure?with?handles?and?user?data?(see?GUIDATA)
%?varargin???command?line?arguments?to?SimulateGUIhanhan?(see?VARARGIN)
%?Choose?default?command?line?output?for?SimulateGUIhanhan
handles.output?=?hobject;
%?Update?handles?structure
guidata(hobject?handles);
Logo=importdata(‘slogan?of?imu.jpg‘);
axes(handles.axes1);
image(Logo);
axis?off;
%?UIWAIT?makes?SimulateGUIhanhan?wait?for?user?response?(see?UIRESUME)
%?uiwait(handles.GuiEditor);
%?---?Outputs?from?this?function?are?returned?to?the?command?line.
function?varargout?=?SimulateGUIhanhan_OutputFcn(hobject?eventdata?handles)?
%?varargout??cell?array?for?returning?output?args?(see?VARARGOUT);
%?hobject????handle?to?figure
%?eventdata??reserved?-?to?be?defined?in?a?future?version?of?MATLAB
%?handles????structure?with?handles?and?user?data?(see?GUIDATA)
%?Get?defa
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件??????32277??2010-09-09?17:32??The?GUI?of?double?inverted?pendulum?simulation?system\SimulateGUIhanhan.m
?????文件??????12630??2010-09-09?18:48??The?GUI?of?double?inverted?pendulum?simulation?system\SimulateGUIhanhan.fig
?????文件??????26137??2010-09-09?18:33??The?GUI?of?double?inverted?pendulum?simulation?system\doublestageGAsimjianhua.mdl
?????文件??????49679??2010-09-09?19:26??The?GUI?of?double?inverted?pendulum?simulation?system\mdl.jpg
?????文件?????141243??2010-09-09?19:26??The?GUI?of?double?inverted?pendulum?simulation?system\fig.jpg
?????目錄??????????0??2010-09-09?18:49??The?GUI?of?double?inverted?pendulum?simulation?system
-----------?---------??----------?-----??----
???????????????261966????????????????????6
評論
共有 條評論