资源简介
一个经典的MATLABgui界面的例子
这是一个相当好用的程序
代码片段和文件信息
function varargout = ArcSimulationSoft( varargin )
% this module open the soft .
% February 2004
% $Revision: 1.00 $
if (nargin == 0) | isstruct( varargin{1} ) % LAUNCH GUI
if nargin == 1
ArcSimulationData = varargin{1} ;
else
ArcSimulationData = [] ;
end
% find if have the same figure and close it .
OldFigure = findobj( ‘type‘ ‘figure‘ ‘Tag‘ ‘ArcSimulationSoft‘ ) ;
if ishandle( OldFigure )
close( OldFigure ) ;
end
% generate a new figure .
FigureHandle = figure( ‘Visible‘ ‘off‘ ) ;
set( FigureHandle ‘Units‘ ‘pixels‘ ‘Position‘ [150 150 500 300] ...
‘Name‘ ‘电弧炉对电网影响仿真软件‘ ...
‘Tag‘ ‘ArcSimulationSoft‘ ...
‘FileName‘ ‘‘ ...
‘MenuBar‘ ‘none‘ ...
‘Numbertitle‘ ‘off‘ ...
‘Resize‘ ‘off‘ ...
‘windowstyle‘ ‘normal‘ ...
‘Visible‘ ‘off‘ ) ;
% generate the menu .
generate_MenuContent( FigureHandle ) ;
% generate the uicontrols .
generate_FigureContent( FigureHandle ) ;
% save the ArcSimulationData .
setappdata( FigureHandle ‘ArcSimulationData‘ ArcSimulationData ) ;
% display the figure .
movegui( FigureHandle ‘center‘ ) ;
set( FigureHandle ‘Visible‘ ‘on‘ ) ;
% init the data .
init_FigureContent( FigureHandle ) ;
if nargout > 0
varargout{1} = FigureHandle;
end
elseif ischar(varargin{1}) % INVOKE NAMED SUBFUNCTION OR CALLBACK
global SET_DEBUG_VALUE_IN_SIMULATOR ;
if isempty( SET_DEBUG_VALUE_IN_SIMULATOR ) | ~isnumeric( SET_DEBUG_VALUE_IN_SIMULATOR )
SET_DEBUG_VALUE_IN_SIMULATOR = 0 ;
else
end
if SET_DEBUG_VALUE_IN_SIMULATOR == 1 ;
if (nargout)
[varargout{1:nargout}] = feval(varargin{:}); % FEVAL switchyard
else
feval(varargin{:}); % FEVAL switchyard
end
else
try
if (nargout)
[varargout{1:nargout}] = feval(varargin{:}); % FEVAL switchyard
else
feval(varargin{:}); % FEVAL switchyard
end
catch
disp(lasterr);
end
end
end
% ------------------------------------------------------------
function generate_MenuContent( FigureHandle ) ;
% generate the file menu .
% ------------------------------------------------------------
MenuHandle = uimenu( ‘Parent‘ FigureHandle ‘Label‘ ‘文件(&F)‘ ) ;
% define the parameters of the menus .
MenuLabel = { ‘打开(&O)‘; ‘退出(&E)‘ } ;
% add Polygon at 2003.10.13 .
MenuTag = { ‘MenuOpenHistory‘; ‘MenuClose‘ } ;
MenuCallback = { ...
[‘ArcSimulationSoft( ‘‘MenuOpenHistory_Callback‘‘ gcbf)‘]; ...
[‘close all;‘] } ;
SeparatorGroup = { ‘off‘; ‘on‘ } ;
% generate the
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 429871 2004-10-04 13:00 经典例子\ArcSimulation
文件 16154 2004-10-04 13:05 经典例子\ArcSimulationSoft.m
文件 7499 2004-03-15 19:45 经典例子\ArcSoftDemo.m
文件 3893 2004-03-15 19:55 经典例子\CalculateEquation.m
文件 29740 2004-10-04 13:06 经典例子\CalculateStatusEquation.m
文件 2381 2004-03-14 01:47 经典例子\CalculateXPCoefficient.m
文件 207014 2004-02-10 00:29 经典例子\CircuitDiagram.bmp
文件 9096 2004-03-14 03:56 经典例子\Data.mat
文件 7992 2004-03-14 00:22 经典例子\DisplayEquationABMatrix.m
文件 19394 2006-05-18 10:48 经典例子\DisplayFFTResult.m
文件 29159 2006-05-18 10:47 经典例子\DisplayResult.m
文件 2457 2004-03-03 12:25 经典例子\DisplayStatusEquation.m
文件 27105 2004-10-04 13:06 经典例子\EditParameter.m
文件 32872 2000-02-04 05:25 经典例子\FigureMenuBar.fig
文件 74008 2000-02-04 05:25 经典例子\FigureToolBar.fig
文件 9386 2004-03-14 12:17 经典例子\GetDefaultArcParameter.m
文件 8369032 2004-03-15 17:23 经典例子\ImageData.mat
文件 850 2004-03-15 17:23 经典例子\ImagesTofr
文件 600294 2004-02-10 00:26 经典例子\MainCircuitFormula.bmp
文件 20480 2003-12-20 14:57 经典例子\mexrun.dll
文件 13793 2004-10-04 13:06 经典例子\SimulateFigure.m
文件 1736 2004-03-15 19:54 经典例子\SimulateModule.m
文件 123320 2004-03-15 21:04 经典例子\SimulationResult.fig
..A.SH. 10240 2005-05-21 19:25 经典例子\Thumbs.db
文件 477942 2004-02-10 01:00 经典例子\UndeePicture.bmp
文件 1026 2004-03-14 01:38 经典例子\xp.m
目录 0 2006-05-18 10:50 经典例子
----------- --------- ---------- ----- ----
10526952 28
............此处省略1个文件信息
- 上一篇:hmm算法matlab实现
- 下一篇:doa估计算法-music算法
评论
共有 条评论