📄 demo1.m
字号:
%DEMO1 MGLab Smoother Demo
%
% This demo displays the smoothing properties of
% some common smoothers by performing a few
% iterations for the model problem with a random
% initial guess and monitoring the error in
% Physical and Fourier space.
%
% Accesses global variables in "demo_globals"
% James Bordner and Faisal Saied
% Department of Computer Science
% University of Illinois at Urbana-Champaign
% 10 April 1995
function demo1_info
%
%
%
demo_globals
page=[ ' Demo 1 ';...
' ';...
' This demo displays the smoothing properties of ';...
' some common smoothers by performing a few ';...
' iterations for the model problem with a random ';...
' initial guess and monitoring the error in ';...
' Physical and Fourier space. ';...
' ';...
' The user can select weighted Jacobi, ';...
' Gauss-Seidel or Red/Black Gauss-Seidel as the ';...
' smoother. ';...
' ';...
' Similar eperiments were presented in ';...
' ';...
' F. Saied and M. Holst. Vector Multigrid: An ';...
' Accuracy and Performance Study. ';...
' Report No UIUCDCS-R-90-1636, Dept of Computer ';...
' Science, University of Illinois at Urbana- ';...
' Champaign ';...
' ';...
' ';...
];
DEMO_INFO_FIG = figure('Position', [30 30 500 600],...
'Name', 'Demo1 Info',...
'NumberTitle', 'off', ...
'Color','blue');
[mm,nn] = size(page);
subplot(1,1,1)
hold off
cla
ht = 0.95;
for j = 1:mm
text(0.05, ht, page(j,:))
axis('off')
ht = ht - 0.04;
end
cb_uic_continue = 'close(DEMO_INFO_FIG), demo1_run';
demo1_uic_continue = uicontrol( 'Position', [0.1 0.05 0.20 0.07],...
'units', 'normalized',...
'style', 'pushbutton', ...
'string', 'Continue',...
'backgroundcolor', 'cyan',...
'foregroundcolor', [0 0 0],...
'callback', cb_uic_continue);
cb_uic_cancel = 'close(DEMO_INFO_FIG)';
demo1_uic_cancel = uicontrol( 'Position', [0.55 0.05 0.20 0.07],...
'units', 'normalized',...
'style', 'pushbutton', ...
'string', 'Cancel',...
'backgroundcolor', 'cyan',...
'foregroundcolor', [0 0 0],...
'callback', cb_uic_cancel);
cb_uic_Jacobi = 'DEMO_VAR1 = 1;';
demo1_uic_cancel = uicontrol( 'Position', [0.10 0.15 0.28 0.07],...
'units', 'normalized',...
'style', 'pushbutton', ...
'string', 'Damped Jacobi',...
'backgroundcolor', 'green',...
'foregroundcolor', [0 0 0],...
'callback', cb_uic_Jacobi);
cb_uic_Gauss_Seidel = 'DEMO_VAR1 = 2;';
demo1_uic_cancel = uicontrol( 'Position', [0.40 0.15 0.28 0.07],...
'units', 'normalized',...
'style', 'pushbutton', ...
'string', 'Gauss Seidel',...
'backgroundcolor', 'green',...
'foregroundcolor', [0 0 0],...
'callback', cb_uic_Gauss_Seidel);
cb_uic_RB_Gauss_Seidel = 'DEMO_VAR1 = 3;';
demo1_uic_cancel = uicontrol( 'Position', [0.70 0.15 0.28 0.07],...
'units', 'normalized',...
'style', 'pushbutton', ...
'string', 'R/B Gauss Seidel',...
'backgroundcolor', 'green',...
'foregroundcolor', [0 0 0],...
'callback', cb_uic_RB_Gauss_Seidel);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -