📄 demo_mmgauss.html
字号:
bottom=bottom+1.5*height;<br> hbtinfo = <span class=graph>uicontrol</span>(...<br> <span class=quotes>'Units'</span>,<span class=quotes>'Normalized'</span>, ...<br> <span class=quotes>'Callback'</span>,<span class=quotes>'demo_mmgauss('</span><span class=quotes>'info'</span><span class=quotes>',gcf)'</span>,...<br> <span class=quotes>'ListboxTop'</span>,0, ...<br> <span class=quotes>'Position'</span>,[left bottom width height], ...<br> <span class=quotes>'String'</span>,<span class=quotes>'Info'</span>);<br><br> <span class=comment>% Step button: perform one adaptation step</span><br> bottom=bottom+1.5*height;<br> hbtstep = <span class=graph>uicontrol</span>(...<br> <span class=quotes>'Units'</span>,<span class=quotes>'Normalized'</span>, ...<br> <span class=quotes>'ListboxTop'</span>,0, ...<br> <span class=quotes>'Position'</span>,[left bottom width height], ...<br> <span class=quotes>'String'</span>,<span class=quotes>'Step'</span>, ...<br> <span class=quotes>'Interruptible'</span>,<span class=quotes>'off'</span>,...<br> <span class=quotes>'Callback'</span>,<span class=quotes>'demo_mmgauss('</span><span class=quotes>'step'</span><span class=quotes>',gcf)'</span>);<br><br> <span class=comment>% Stop button: stop process of adaptation</span><br> bottom=bottom+height;<br> hbtstop = <span class=graph>uicontrol</span>(...<br> <span class=quotes>'Units'</span>,<span class=quotes>'Normalized'</span>, ...<br> <span class=quotes>'ListboxTop'</span>,0, ...<br> <span class=quotes>'Position'</span>,[left bottom width height], ...<br> <span class=quotes>'String'</span>,<span class=quotes>'Stop'</span>, ...<br> <span class=quotes>'Callback'</span>,<span class=quotes>'set(gcbo,'</span><span class=quotes>'UserData'</span><span class=quotes>',1)'</span>,...<br> <span class=quotes>'Enable'</span>,<span class=quotes>'off'</span>);<br><br> <span class=comment>% Play button: start up adaptation</span><br> bottom=bottom+height;<br> hbtplay = <span class=graph>uicontrol</span>(...<br> <span class=quotes>'Units'</span>,<span class=quotes>'Normalized'</span>, ...<br> <span class=quotes>'ListboxTop'</span>,0, ...<br> <span class=quotes>'Position'</span>,[left bottom width height], ...<br> <span class=quotes>'String'</span>,<span class=quotes>'Play'</span>, ...<br> <span class=quotes>'Callback'</span>,<span class=quotes>'demo_mmgauss('</span><span class=quotes>'play'</span><span class=quotes>',gcf)'</span>);<br><br> <span class=comment>% Reset button: set up t = 0</span><br> bottom=bottom+height;<br> hbtreset = <span class=graph>uicontrol</span>(...<br> <span class=quotes>'Units'</span>,<span class=quotes>'Normalized'</span>, ...<br> <span class=quotes>'ListboxTop'</span>,0, ...<br> <span class=quotes>'Position'</span>,[left bottom width height], ...<br> <span class=quotes>'String'</span>,<span class=quotes>'Reset'</span>, ...<br> <span class=quotes>'Callback'</span>,<span class=quotes>'demo_mmgauss('</span><span class=quotes>'reset'</span><span class=quotes>',gcf)'</span>);<br><br> <span class=comment>% Create data</span><br> bottom=bottom+1.5*height;<br> hbtcreat = <span class=graph>uicontrol</span>(...<br> <span class=quotes>'Units'</span>,<span class=quotes>'Normalized'</span>, ...<br> <span class=quotes>'ListboxTop'</span>,0, ...<br> <span class=quotes>'Position'</span>,[left bottom width height], ...<br> <span class=quotes>'String'</span>,<span class=quotes>'Create data'</span>, ...<br> <span class=quotes>'Callback'</span>,<span class=quotes>'demo_mmgauss('</span><span class=quotes>'creatdata'</span><span class=quotes>',gcf)'</span>);<br><br> <span class=comment>% Load data</span><br> bottom=bottom+1*height;<br> hbtload = <span class=graph>uicontrol</span>(...<br> <span class=quotes>'Units'</span>,<span class=quotes>'Normalized'</span>, ...<br> <span class=quotes>'ListboxTop'</span>,0, ...<br> <span class=quotes>'Position'</span>,[left bottom width height], ...<br> <span class=quotes>'String'</span>,<span class=quotes>'Load data'</span>, ...<br> <span class=quotes>'Callback'</span>,<span class=quotes>'demo_mmgauss('</span><span class=quotes>'getfile'</span><span class=quotes>',gcf)'</span>);<br><br> <span class=comment>% == Edit line ==========================================================</span><br><br> <span class=comment>% epsilon</span><br> bottom=0.95-height;<br> htxeps=<span class=graph>uicontrol</span>( ...<br> <span class=quotes>'Style'</span>,<span class=quotes>'text'</span>, ...<br> <span class=quotes>'Units'</span>,<span class=quotes>'normalized'</span>, ...<br> <span class=quotes>'Position'</span>,[left bottom width 0.9*height], ...<br> <span class=quotes>'String'</span>,<span class=quotes>'epsilon'</span>);<br> bottom=bottom-height;<br> hedeps = <span class=graph>uicontrol</span>(...<br> <span class=quotes>'Units'</span>,<span class=quotes>'normalized'</span>, ...<br> <span class=quotes>'ListboxTop'</span>,0, ...<br> <span class=quotes>'Position'</span>,[left bottom width height], ...<br> <span class=quotes>'Style'</span>,<span class=quotes>'edit'</span>,...<br> <span class=quotes>'String'</span>,<span class=quotes>'0.1'</span>);<br><br> <span class=comment>% Iterations</span><br> bottom=bottom-1.5*height;<br> htxiter=<span class=graph>uicontrol</span>( ...<br> <span class=quotes>'Style'</span>,<span class=quotes>'text'</span>, ...<br> <span class=quotes>'Units'</span>,<span class=quotes>'normalized'</span>, ...<br> <span class=quotes>'Position'</span>,[left bottom width 0.9*height], ...<br> <span class=quotes>'String'</span>,<span class=quotes>'Iterations'</span>);<br> bottom=bottom-height;<br> hediter = <span class=graph>uicontrol</span>(...<br> <span class=quotes>'Units'</span>,<span class=quotes>'normalized'</span>, ...<br> <span class=quotes>'ListboxTop'</span>,0, ...<br> <span class=quotes>'Position'</span>,[left bottom width height], ...<br> <span class=quotes>'Style'</span>,<span class=quotes>'edit'</span>,...<br> <span class=quotes>'String'</span>,<span class=quotes>'1'</span>);<br><br> <span class=comment>% == Texts ===========================================================</span><br><br> htitle1=title(<span class=quotes>'No data loaded'</span>,...<br> <span class=quotes>'Parent'</span>,haset,...<br> <span class=quotes>'VerticalAlignment'</span>,<span class=quotes>'bottom'</span>,...<br> <span class=quotes>'HorizontalAlignment'</span>,<span class=quotes>'left'</span>,...<br> <span class=quotes>'Units'</span>,<span class=quotes>'normalized'</span>,...<br> <span class=quotes>'Position'</span>,[0 1 0]);<br><br> <span class=comment>%=====================================================================</span><br> <span class=comment>% Store handlers</span><br> handlers=struct(...<br> <span class=quotes>'ellipse'</span>,struct(<span class=quotes>'handler'</span>,-1,<span class=quotes>'center'</span>,-1,<span class=quotes>'mi'</span>,[],<span class=quotes>'sigma'</span>,[],<span class=quotes>'t'</span>,0,<span class=quotes>'N'</span>,[]),...<br> <span class=quotes>'plot1'</span>,struct(<span class=quotes>'handler'</span>,-1,<span class=quotes>'topps'</span>,[],<span class=quotes>'axist'</span>,0,<span class=quotes>'time'</span>,[]),...<br> <span class=quotes>'plot2'</span>,struct(<span class=quotes>'handler'</span>,-1,<span class=quotes>'minps'</span>,[]),...<br> <span class=quotes>'title1'</span>,htitle1,...<br> <span class=quotes>'btstep'</span>,hbtstep,...<br> <span class=quotes>'btstop'</span>,hbtstop,...<br> <span class=quotes>'btclose'</span>,hbtclose,...<br> <span class=quotes>'btplay'</span>,hbtplay,...<br> <span class=quotes>'btreset'</span>,hbtreset,...<br> <span class=quotes>'btinfo'</span>,hbtinfo,...<br> <span class=quotes>'btload'</span>,hbtload,...<br> <span class=quotes>'btcreat'</span>,hbtcreat,...<br> <span class=quotes>'txsteps'</span>,htxsteps,...<br> <span class=quotes>'txeps'</span>,htxeps,...<br> <span class=quotes>'txiter'</span>,htxiter,...<br> <span class=quotes>'aset'</span>,haset,...<br> <span class=quotes>'aprob'</span>,haprob,...<br> <span class=quotes>'editer'</span>,hediter,...<br> <span class=quotes>'edeps'</span>,hedeps);<br> <span class=graph>set</span>(hfigure,<span class=quotes>'UserData'</span>,handlers)<br><br> <span class=comment>% Reset</span><br> demo_mmgauss(<span class=quotes>'reset'</span>,hfigure);<br><br> <span class=comment>% Put figure on desktop</span><br> <span class=graph>set</span>(hfigure,<span class=quotes>'Visible'</span>,<span class=quotes>'on'</span>);<br> drawnow;<br><br><br><span class=label>case</span> <span class=quotes>'play'</span><br> <span class=comment>% == One step learning ==============================================</span><br> h=<span class=graph>get</span>(hfigure,<span class=quotes>'UserData'</span>);<br><br> <span class=comment>% get data set</span><br> sets=<span class=graph>get</span>(h.aset,<span class=quotes>'UserData'</span>);<br><br> <span class=comment>% are data sets loaded ?</span><br> <span class=keyword>if</span> isempty(sets)==1,<br> <span class=jump>return</span>;<br> <span class=keyword>end</span><br><br> <span class=comment>% disable button</span><br> <span class=graph>set</span>([h.editer,h.edeps,h.btstep,h.btclose,h.btplay,...<br> h.btreset,h.btinfo,h.btload,h.btcreat,h.txeps,h.txiter],...<br>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -