📄 displayequationabmatrix.m
字号:
function varargout = DisplayEquationABMatrix( varargin )
% this module edit the parameters .
% February 2004
% $Revision: 1.00 $
if (nargin == 0) | isstruct( varargin{1} ) % LAUNCH GUI
if nargin == 1
T_SimulationData = varargin{1} ;
else
T_SimulationData = [] ;
end
% find if have the same figure, and close it .
OldFigure = findobj( 'type', 'figure', 'Tag', 'DisplayEquationABMatrix' ) ;
if ishandle( OldFigure )
close( OldFigure ) ;
end
% generate a new figure .
FigureHandle = figure( 'Visible', 'off' ) ;
set( FigureHandle, 'Units' , 'pixels', 'Position', [150 150 500 300], ...
'Name', 'T型自卸汽车优化分析程序', ...
'Tag', 'DisplayEquationABMatrix', ...
'FileName' , '' ,...
'MenuBar' , 'none' ,...
'NumberTitle' , 'off' ,...
'Resize', 'on', ...
'windowstyle', 'normal', ...
'Visible', 'off' ) ;
% generate the uicontrols .
generate_FigureContent( FigureHandle ) ;
% save the T_SimulationData .
setappdata( FigureHandle, 'T_SimulationData', T_SimulationData ) ;
% display the figure .
movegui( FigureHandle, 'center' ) ;
set( get( FigureHandle, 'Children' ), 'Units', 'normalized' ) ;
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_FigureContent( FigureHandle )
% generate the uicontrols .
% init the variables .
FigureWidth = 600 ;
FigureHeight = 400 ;
TabSpace = 10 ;
TextHeight = 22 ;
ChangeYPos = 30 ;
% reset the figure's size .
set( FigureHandle, 'Units', 'pixels', ...
'Position', [160 170 FigureWidth FigureHeight], ...
'DoubleBuffer', 'on' ) ;
% generate the axes to plot lines .
AxesHandle = axes( 'Parent', FigureHandle, 'Units' , 'normalized' , ...
'Position', [0 0 1 1], 'Visible', 'off', ...
'Xlim', [0 FigureWidth], 'Ylim', [0 FigureHeight] ) ;
% get the color of the figure .
FigureColor = get( FigureHandle, 'Color' ) ;
% reset the default value of the uicontrols .
set(FigureHandle,'defaultuicontrolunits','normalized');
set(FigureHandle,'defaultuicontrolfontname','隶书');
set(FigureHandle,'defaultuicontrolBackgroundColor', FigureColor );
% generate the parameters of the 状态方程 .
% -----------------------------------------------------------------------------
% define the second frame .
FrameXPos = TabSpace * 2 ;
FrameWidth = (FigureWidth - TabSpace * 4) ;
FrameYPos = TabSpace * 6 ;
FrameHeight = FigureHeight - FrameYPos - TabSpace * 2 ;
Frame1Position = [FrameXPos FrameYPos FrameWidth FrameHeight] ;
% generate a frame .
TextXPos = Frame1Position(1) + 15 ;
TextYPos = Frame1Position(2) + Frame1Position(4) - 20 ;
TextWidth = 250 ;
TextPosition = [TextXPos TextYPos TextWidth TextHeight] ;
% subtitle: 状态方程
SubtitleHandle = uicontrol(FigureHandle, 'Style','text', 'Units','pixels',...
'position',TextPosition,'Horizontal','center',...
'string', 'T型自卸汽车受力模型', 'fontsize',15 );
% load the picture data .
ImageCData = imread( 'Tt.bmp', 'BMP' ) ;
for num1 = 1:3
ImageCData(:,:,num1) = flipud( ImageCData(:,:,num1) ) ;
end
ImageXPos = TabSpace * 2.5 ;
ImageYPos = TabSpace * 2.5 ;
ImageWidth = 350 ;
ImageHeight = 280 ;
ImageXData = ImageXPos + [0 ImageWidth] +30;
ImageYData = ImageYPos + [0 ImageHeight] +20 ;
% generate a image to display picture .
MovieImageHandle = image( 'Parent', AxesHandle, ...
'XData', ImageXData, 'YData', ImageYData, ...
'Cdata', ImageCData ) ;
h_text=uicontrol(FigureHandle,'style','text', 'unit','pixels',...
'position',[450 50 100 300],'Horizontal','center',...
'string',{'A(x1,x2)'; ''; 'O1(x3,x4),',...
;'';'O2(x5,x6)';'';'BC=x7';'';'AC=x8';'';'AB=x9';'';'BO1=x10'},'fontsize',13);
ButtonWidth = 80 ;
ButtonHeight = 25 ;
ButtonXPos = FigureWidth - ButtonWidth - TabSpace * 3 ;
ButtonYPos = TabSpace * 2 ;;
ButtonPosition = [ButtonXPos ButtonYPos ButtonWidth ButtonHeight] ;
% generate the pushbutton: Close .
ButtonHandle = uicontrol( 'Parent', FigureHandle, 'Units', 'Pixels', 'Position', ButtonPosition, ...
'Style', 'pushbutton', 'string', '关闭', 'Fontsize',12, 'Callback', ['close(gcbf) ;'] ) ;
set( FigureHandle, 'Visible', 'on' ) ;
handles = guihandles( FigureHandle ) ;
guidata( FigureHandle, handles ) ;
% --------------------------------------------------------------------------
function init_FigureContent( h )
handles = guidata( h ) ;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -