📄 createdata.html
字号:
<span class=quotes>'Position'</span>,[left+width*0.5 bottom width*0.5 height], ...
<br> <span class=quotes>'CallBack'</span>,<span class=quotes>'createdata('</span><span class=quotes>'setcov'</span><span class=quotes>',gcf,4)'</span>,...
<br> <span class=quotes>'Style'</span>,<span class=quotes>'edit'</span>,...
<br> <span class=quotes>'String'</span>,<span class=quotes>'1'</span>);
<br>
<br> bottom=bottom-1.2*height;
<br> htxmi1=<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>'MI=['</span>);
<br> bottom=bottom-0.9*height;
<br> htxmi2=<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>' ]'</span>);
<br> <span class=keyword>end</span>
<br>
<br> <span class=comment>% == Axes title ========================================================
</span><br> pos=<span class=graph>get</span>(haxes1,<span class=quotes>'Position'</span>);
<br> titletext=<span class=io>sprintf</span>(<span class=quotes>'File: %s'</span>,file.name);
<br> fontsize=(1-pos(2)-pos(4))*0.8;
<br> htitle=title(titletext,...
<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>'FontUnits'</span>,<span class=quotes>'normalized'</span>,...
<br> <span class=quotes>'Units'</span>,<span class=quotes>'normalized'</span>,...
<br> <span class=quotes>'Position'</span>,[0 1 0],...
<br> <span class=quotes>'FontSize'</span>,fontsize);
<br>
<br>
<br> <span class=comment>% =========================================================================
</span><br>
<br> <span class=comment>% create the structures according to the current set type
</span><br> <span class=keyword>switch</span> lower(<span class=stack>varargin</span>{1}),
<br> <span class=label>case</span> <span class=quotes>'finite'</span>
<br> <span class=graph>set</span>(hfigure,<span class=quotes>'name'</span>,<span class=quotes>'Generator of finite point sets'</span>);
<br> ident=ID_FINITE;
<br> <span class=comment>% set handlers
</span><br> handlers=struct(...
<br> <span class=quotes>'settype'</span>,lower(<span class=stack>varargin</span>{1}),...
<br> <span class=quotes>'saved'</span>,1,...
<br> <span class=quotes>'btsave'</span>,hbtsave,...
<br> <span class=quotes>'edxaxis'</span>,hedxaxis,...
<br> <span class=quotes>'edyaxis'</span>,hedyaxis,...
<br> <span class=quotes>'title'</span>,htitle,...
<br> <span class=quotes>'btok'</span>,hbtok,...
<br> <span class=quotes>'axes1'</span>,haxes1,...
<br> <span class=quotes>'puclass'</span>,hpuclass );
<br> <span class=label>case</span> <span class=quotes>'gauss'</span>
<br> <span class=graph>set</span>(hfigure,<span class=quotes>'name'</span>,<span class=quotes>'Generator of Gaussian distributions'</span>);
<br> ident=ID_NORMAL;
<br> <span class=comment>% set handlers
</span><br> handlers=struct(...
<br> <span class=quotes>'settype'</span>,lower(<span class=stack>varargin</span>{1}),...
<br> <span class=quotes>'currpoint'</span>,0,...
<br> <span class=quotes>'currhandle'</span>,0,...
<br> <span class=quotes>'saved'</span>,1,...
<br> <span class=quotes>'title'</span>,htitle,...
<br> <span class=quotes>'btsave'</span>,hbtsave,...
<br> <span class=quotes>'edxaxis'</span>,hedxaxis,...
<br> <span class=quotes>'edyaxis'</span>,hedyaxis,...
<br> <span class=quotes>'txmi1'</span>,htxmi1,...
<br> <span class=quotes>'txmi2'</span>,htxmi2,...
<br> <span class=quotes>'edxx'</span>,hedxx,...
<br> <span class=quotes>'edxy'</span>,hedxy,...
<br> <span class=quotes>'edyx'</span>,hedyx,...
<br> <span class=quotes>'edyy'</span>,hedyy,...
<br> <span class=quotes>'btok'</span>,hbtok,...
<br> <span class=quotes>'axes1'</span>,haxes1,...
<br> <span class=quotes>'puclass'</span>,hpuclass );
<br> <span class=keyword>end</span>
<br>
<br> sets=struct(...
<br> <span class=quotes>'K'</span>,zeros(1,K),...
<br> <span class=quotes>'X'</span>,[],...
<br> <span class=quotes>'I'</span>,[],...
<br> <span class=quotes>'MI'</span>,[],...
<br> <span class=quotes>'SIGMA'</span>,[],...
<br> <span class=quotes>'N'</span>,2,...
<br> <span class=quotes>'id'</span>,ident);
<br>
<br> <span class=comment>% store handlers and data set structure
</span><br> <span class=graph>set</span>(hfigure,<span class=quotes>'UserData'</span>,handlers);
<br> <span class=graph>set</span>(haxes1,<span class=quotes>'UserData'</span>,sets);
<br>
<br>
<br> <span class=comment>% set figure as visible
</span><br> <span class=graph>set</span>(hfigure,<span class=quotes>'Visible'</span>,<span class=quotes>'on'</span>);
<br>
<br>
<br><span class=label>case</span> <span class=quotes>'setcov'</span>
<br> <span class=comment>% == Set covariance matrix of current selected point ===================
</span><br>
<br> <span class=comment>% get handlers
</span><br> hfigure=<span class=stack>varargin</span>{1};
<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.axes1,<span class=quotes>'UserData'</span>);
<br>
<br> <span class=comment>% current point
</span><br> i=h.currpoint;
<br>
<br> <span class=keyword>if</span> <span class=stack>varargin</span>{2}==2,
<br> <span class=graph>set</span>(h.edyx,<span class=quotes>'String'</span>,<span class=graph>get</span>(h.edxy,<span class=quotes>'String'</span>));
<br> <span class=keyword>elseif</span> <span class=stack>varargin</span>{2}==3,
<br> <span class=graph>set</span>(h.edxy,<span class=quotes>'String'</span>,<span class=graph>get</span>(h.edyx,<span class=quotes>'String'</span>));
<br> <span class=keyword>end</span>
<br>
<br> <span class=comment>% if some point is selected
</span><br> <span class=keyword>if</span> i ~= 0,
<br> <span class=comment>% get cov. matrix from edit lines
</span><br> sigma(1,1)=str2num(<span class=graph>get</span>(h.edxx,<span class=quotes>'String'</span>));
<br> sigma(1,2)=str2num(<span class=graph>get</span>(h.edxy,<span class=quotes>'String'</span>));
<br> sigma(2,1)=str2num(<span class=graph>get</span>(h.edyx,<span class=quotes>'String'</span>));
<br> sigma(2,2)=str2num(<span class=graph>get</span>(h.edyy,<span class=quotes>'String'</span>));
<br>
<br> <span class=comment>% is sigma positive definite ?
</span><br> [aa,p]=chol(sigma);
<br> <span class=keyword>if</span> p ~= 0,
<br> <span class=graph>set</span>(h.edxx,<span class=quotes>'String'</span>,<span class=quotes>'1'</span>);
<br> <span class=graph>set</span>(h.edxy,<span class=quotes>'String'</span>,<span class=quotes>'0'</span>);
<br> <span class=graph>set</span>(h.edyx,<span class=quotes>'String'</span>,<span class=quotes>'0'</span>);
<br> <span class=graph>set</span>(h.edyy,<span class=quotes>'String'</span>,<span class=quotes>'1'</span>);
<br> sigma=eye(2,2);
<br> <span class=keyword>end</span>
<br>
<br> sets.SIGMA(:,(i-1)*2+1:i*2)=sigma;
<br> <span class=graph>set</span>(h.axes1,<span class=quotes>'UserData'</span>,sets);
<br>
<br><span class=comment>%%% window=axis;
</span><br> window=getaxis(h.axes1);
<br> R=min([(window(2)-window(1)),(window(4)-window(3))])/20;
<br> i=h.currpoint;
<br>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -