数模论坛

 找回密码
 注-册-帐-号
搜索
热搜: 活动 交友 discuz
楼主: 宝宝

【编程学习】matlab实用程序百例

  [复制链接]
 楼主| 发表于 2004-6-1 18:46:33 | 显示全部楼层
<><FONT size=1><b><EM>实例91:gauss消去法</EM></b></FONT></P><>h0=figure('toolbar','none',...
    'position',[200 150 450 250],...
    'name','实例91');
h1=axes('parent',h0,...
    'position',[0.05 0.15 0.65 0.6],...
    'visible','off');
I=imread('abmatrix.bmp','bmp');
image(I)
axis off
huidiao=[...
        'a=[1 2 4 1 7;2 3 0 1 8;4 1 7 6 1;1 1 0 2 1;1 3 0 1 1;];,',...
        'b=[15 14 19 5 6]'';,',...
        'r=[a,b];,',...
        'n=5;,',...
        'tic,',...
        'x=gauss(r,n);,',...
        'time1=toc;,',...
        'T=num2str(time1);,',...
        'set(e1,''string'',[T,''秒'']);,',...
        'msgbox([''X=['',num2str(x(1)),num2str(x(2)),num2str(x(3)),num2str(x(4)),num2str(x(5)),'']''],''方程组的解'');'];
t1=uicontrol('parent',h0,...
    'units','points',...
    'tag','t1',...
    'style','text',...
    'string','方程组如下:',...
    'fontsize',15,...
    'backgroundcolor',[0.75 0.75 0.75],...
    'position',[20 150 100 20]);
e1=uicontrol('parent',h0,...
    'units','points',...
    'tag','e1',...
    'style','edit',...
    'horizontalalignment','right',...
    'backgroundcolor',[1 1 1],...
    'position',[290 100 30 20]);
t2=uicontrol('parent',h0,...
    'units','points',...
    'tag','t2',...
    'style','text',...
    'string','计算时间:',...
    'fontsize',15,...
    'backgroundcolor',[0.75 0.75 0.75],...
    'position',[250 125 80 20]);
b1=uicontrol('parent',h0,...
    'units','points',...
    'tag','b1',...
    'style','pushbutton',...
    'string','GS消去法',...
    'backgroundcolor',[0.75 0.75 0.75],...
    'position',[250 60 60 20],...
    'callback',huidiao);
b2=uicontrol('parent',h0,...
    'units','points',...
    'tag','b2',...
    'string','关闭',...
    'style','pushbutton',...
    'backgroundcolor',[0.75 0.75 0.75],...
    'position',[250 30 60 20],...
    'callback','close');</P>
 楼主| 发表于 2004-6-1 18:47:15 | 显示全部楼层
<><FONT size=1>实例92:三角分解法</FONT></P><>h0=figure('toolbar','none',...
    'position',[200 150 450 250],...
    'name','实例92');
h1=axes('parent',h0,...
    'position',[0.05 0.15 0.65 0.6],...
    'visible','off');
I=imread('abmatrix.bmp','bmp');
image(I)
axis off
huidiao=[...
        'a=[1 2 4 1 7;2 3 0 1 8;4 1 7 6 1;1 1 0 2 1;1 3 0 1 1;];,',...
        'b=[15 14 19 5 6]'';,',...
        'n=5;,',...
        'tic,',...
        'x=dirang(a,b,n);,',...
        'time1=toc;,',...
        'T=num2str(time1);,',...
        'set(e1,''string'',[T,''秒'']);,',...
        'msgbox([''X=['',num2str(x(1)),num2str(x(2)),num2str(x(3)),num2str(x(4)),num2str(x(5)),'']''],''方程组的解'');'];
t1=uicontrol('parent',h0,...
    'units','points',...
    'tag','t1',...
    'style','text',...
    'string','方程组如下:',...
    'fontsize',15,...
    'backgroundcolor',[0.75 0.75 0.75],...
    'position',[20 150 100 20]);
e1=uicontrol('parent',h0,...
    'units','points',...
    'tag','e1',...
    'style','edit',...
    'horizontalalignment','right',...
    'backgroundcolor',[1 1 1],...
    'position',[270 100 50 20]);
t2=uicontrol('parent',h0,...
    'units','points',...
    'tag','t2',...
    'style','text',...
    'string','计算时间:',...
    'fontsize',15,...
    'backgroundcolor',[0.75 0.75 0.75],...
    'position',[250 125 80 20]);
b1=uicontrol('parent',h0,...
    'units','points',...
    'tag','b1',...
    'style','pushbutton',...
    'string','三角分解法',...
    'backgroundcolor',[0.75 0.75 0.75],...
    'position',[250 60 60 20],...
    'callback',huidiao);
b2=uicontrol('parent',h0,...
    'units','points',...
    'tag','b2',...
    'string','关闭',...
    'style','pushbutton',...
    'backgroundcolor',[0.75 0.75 0.75],...
    'position',[250 30 60 20],...
    'callback','close');</P>
 楼主| 发表于 2004-6-1 18:48:09 | 显示全部楼层
<><FONT size=1><b><EM>实例93:jacobi迭代法</EM></b></FONT></P><>h0=figure('toolbar','none',...
    'position',[200 150 450 250],...
    'name','实例93');
h1=axes('parent',h0,...
    'position',[0.05 0.15 0.65 0.6],...
    'visible','off');
I=imread('abmatrix.bmp','bmp');
image(I)
axis off
huidiao=[...
        'a=[1 0 3 0;0 2 1 2;3 1 15 0;0 2 0 4;];,',...
        'b=[1 6 5 8]'';,',...
        'n=4;,',...
        'u=zeros(n,1);,',...
        'tic,',...
        '[x,k]=jac(a,b,n,u);,',...
        'time1=toc;,',...
        'T=num2str(time1);,',...
        'set(e1,''string'',[T,''秒'']);,',...
        'set(e2,''string'',num2str(k));,',...
        'msgbox([''X=['',num2str(x(1)),'' '',num2str(x(2)),'' '',num2str(x(3)),'','',num2str(x(4)),'']''],''方程组的解'');'];
t1=uicontrol('parent',h0,...
    'units','points',...
    'tag','t1',...
    'style','text',...
    'string','方程组如下:',...
    'fontsize',15,...
    'backgroundcolor',[0.75 0.75 0.75],...
    'position',[20 150 100 20]);
e1=uicontrol('parent',h0,...
    'units','points',...
    'tag','e1',...
    'style','edit',...
    'horizontalalignment','right',...
    'backgroundcolor',[1 1 1],...
    'position',[295 130 35 20]);
t2=uicontrol('parent',h0,...
    'units','points',...
    'tag','t2',...
    'style','text',...
    'string','计算时间:',...
    'fontsize',10,...
    'backgroundcolor',[0.75 0.75 0.75],...
    'position',[240 130 50 20]);
e2=uicontrol('parent',h0,...
    'units','points',...
    'tag','e2',...
    'style','edit',...
    'horizontalalignment','right',...
    'backgroundcolor',[1 1 1],...
    'position',[295 100 35 20]);
t2=uicontrol('parent',h0,...
    'units','points',...
    'tag','t2',...
    'style','text',...
    'string','迭代步数:',...
    'fontsize',10,...
    'backgroundcolor',[0.75 0.75 0.75],...
    'position',[240 100 50 20]);
b1=uicontrol('parent',h0,...
    'units','points',...
    'tag','b1',...
    'style','pushbutton',...
    'string','Jacobi 迭代法',...
    'backgroundcolor',[0.75 0.75 0.75],...
    'position',[250 60 60 20],...
    'callback',huidiao);
b2=uicontrol('parent',h0,...
    'units','points',...
    'tag','b2',...
    'string','关闭',...
    'style','pushbutton',...
    'backgroundcolor',[0.75 0.75 0.75],...
    'position',[250 30 60 20],...
    'callback','close');</P>
 楼主| 发表于 2004-6-1 18:48:40 | 显示全部楼层
<><FONT size=1><b><EM>实例94:gauss迭代法</EM></b></FONT></P><>h0=figure('toolbar','none',...
    'position',[200 150 450 250],...
    'name','实例94');
h1=axes('parent',h0,...
    'position',[0.05 0.15 0.65 0.6],...
    'visible','off');
I=imread('abmatrix.bmp','bmp');
image(I)
axis off
huidiao=[...
        'a=[1 0 3 0;0 2 1 2;3 1 15 0;0 2 0 4;];,',...
        'b=[1 6 5 8]'';,',...
        'n=4;,',...
        'u=zeros(n,1);,',...
        'tic,',...
        '[x,k]=gs(a,b,n,u);,',...
        'time1=toc;,',...
        'T=num2str(time1);,',...
        'set(e1,''string'',[T,''秒'']);,',...
        'set(e2,''string'',num2str(k));,',...
        'msgbox([''X=['',num2str(x(1)),'' '',num2str(x(2)),'' '',num2str(x(3)),'','',num2str(x(4)),'']''],''方程组的解'');'];
t1=uicontrol('parent',h0,...
    'units','points',...
    'tag','t1',...
    'style','text',...
    'string','方程组如下:',...
    'fontsize',15,...
    'backgroundcolor',[0.75 0.75 0.75],...
    'position',[20 150 100 20]);
e1=uicontrol('parent',h0,...
    'units','points',...
    'tag','e1',...
    'style','edit',...
    'horizontalalignment','right',...
    'backgroundcolor',[1 1 1],...
    'position',[295 130 35 20]);
t2=uicontrol('parent',h0,...
    'units','points',...
    'tag','t2',...
    'style','text',...
    'string','计算时间:',...
    'fontsize',10,...
    'backgroundcolor',[0.75 0.75 0.75],...
    'position',[240 130 50 20]);
e2=uicontrol('parent',h0,...
    'units','points',...
    'tag','e2',...
    'style','edit',...
    'horizontalalignment','right',...
    'backgroundcolor',[1 1 1],...
    'position',[295 100 35 20]);
t2=uicontrol('parent',h0,...
    'units','points',...
    'tag','t2',...
    'style','text',...
    'string','迭代步数:',...
    'fontsize',10,...
    'backgroundcolor',[0.75 0.75 0.75],...
    'position',[240 100 50 20]);
b1=uicontrol('parent',h0,...
    'units','points',...
    'tag','b1',...
    'style','pushbutton',...
    'string','GS 迭代法',...
    'backgroundcolor',[0.75 0.75 0.75],...
    'position',[250 60 60 20],...
    'callback',huidiao);
b2=uicontrol('parent',h0,...
    'units','points',...
    'tag','b2',...
    'string','关闭',...
    'style','pushbutton',...
    'backgroundcolor',[0.75 0.75 0.75],...
    'position',[250 30 60 20],...
    'callback','close');</P>
 楼主| 发表于 2004-6-1 18:49:10 | 显示全部楼层
<><FONT size=1><b><EM>实例95:sor迭代法</EM></b></FONT></P><>h0=figure('toolbar','none',...
    'position',[200 150 450 250],...
    'name','实例95');
h1=axes('parent',h0,...
    'position',[0.05 0.15 0.65 0.6],...
    'visible','off');
I=imread('abmatrix.bmp','bmp');
image(I)
axis off
huidiao=[...
        'a=[1 0 3 0;0 2 1 2;3 1 15 0;0 2 0 4;];,',...
        'b=[1 6 5 8]'';,',...
        'n=4;,',...
        'u=zeros(n,1);,',...
        'tic,',...
        '[x,k]=sor(a,b,n,u);,',...
        'time1=toc;,',...
        'T=num2str(time1);,',...
        'set(e1,''string'',[T,''秒'']);,',...
        'set(e2,''string'',num2str(k));,',...
        'msgbox([''X=['',num2str(x(1)),'' '',num2str(x(2)),'' '',num2str(x(3)),'','',num2str(x(4)),'']''],''方程组的解'');'];
t1=uicontrol('parent',h0,...
    'units','points',...
    'tag','t1',...
    'style','text',...
    'string','方程组如下:',...
    'fontsize',15,...
    'backgroundcolor',[0.75 0.75 0.75],...
    'position',[20 150 100 20]);
e1=uicontrol('parent',h0,...
    'units','points',...
    'tag','e1',...
    'style','edit',...
    'horizontalalignment','right',...
    'backgroundcolor',[1 1 1],...
    'position',[295 130 35 20]);
t2=uicontrol('parent',h0,...
    'units','points',...
    'tag','t2',...
    'style','text',...
    'string','计算时间:',...
    'fontsize',10,...
    'backgroundcolor',[0.75 0.75 0.75],...
    'position',[240 130 50 20]);
e2=uicontrol('parent',h0,...
    'units','points',...
    'tag','e2',...
    'style','edit',...
    'horizontalalignment','right',...
    'backgroundcolor',[1 1 1],...
    'position',[295 100 35 20]);
t2=uicontrol('parent',h0,...
    'units','points',...
    'tag','t2',...
    'style','text',...
    'string','迭代步数:',...
    'fontsize',10,...
    'backgroundcolor',[0.75 0.75 0.75],...
    'position',[240 100 50 20]);
b1=uicontrol('parent',h0,...
    'units','points',...
    'tag','b1',...
    'style','pushbutton',...
    'string','SOR 迭代法',...
    'backgroundcolor',[0.75 0.75 0.75],...
    'position',[250 60 60 20],...
    'callback',huidiao);
b2=uicontrol('parent',h0,...
    'units','points',...
    'tag','b2',...
    'string','关闭',...
    'style','pushbutton',...
    'backgroundcolor',[0.75 0.75 0.75],...
    'position',[250 30 60 20],...
    'callback','close');</P>
 楼主| 发表于 2004-6-1 18:49:43 | 显示全部楼层
<><FONT size=1><b><EM>实例96:最速下降法</EM></b></FONT></P><>h0=figure('toolbar','none',...
    'position',[200 150 450 250],...
    'name','实例96');
h1=axes('parent',h0,...
    'position',[0.05 0.15 0.65 0.6],...
    'visible','off');
I=imread('abmatrix.bmp','bmp');
image(I)
axis off
huidiao=[...
        'a=[1 0 3 0;0 2 1 2;3 1 15 0;0 2 0 4;];,',...
        'b=[1 6 5 8]'';,',...
        'n=4;,',...
        'u=zeros(n,1);,',...
        'tic,',...
        '[x,k]=cg(a,b,n,u);,',...
        'time1=toc;,',...
        'T=num2str(time1);,',...
        'set(e1,''string'',[T,''秒'']);,',...
        'set(e2,''string'',num2str(k));,',...
        'msgbox([''X=['',num2str(x(1)),'' '',num2str(x(2)),'' '',num2str(x(3)),'','',num2str(x(4)),'']''],''方程组的解'');'];
t1=uicontrol('parent',h0,...
    'units','points',...
    'tag','t1',...
    'style','text',...
    'string','方程组如下:',...
    'fontsize',15,...
    'backgroundcolor',[0.75 0.75 0.75],...
    'position',[20 150 100 20]);
e1=uicontrol('parent',h0,...
    'units','points',...
    'tag','e1',...
    'style','edit',...
    'horizontalalignment','right',...
    'backgroundcolor',[1 1 1],...
    'position',[295 130 35 20]);
t2=uicontrol('parent',h0,...
    'units','points',...
    'tag','t2',...
    'style','text',...
    'string','计算时间:',...
    'fontsize',10,...
    'backgroundcolor',[0.75 0.75 0.75],...
    'position',[240 130 50 20]);
e2=uicontrol('parent',h0,...
    'units','points',...
    'tag','e2',...
    'style','edit',...
    'horizontalalignment','right',...
    'backgroundcolor',[1 1 1],...
    'position',[295 100 35 20]);
t2=uicontrol('parent',h0,...
    'units','points',...
    'tag','t2',...
    'style','text',...
    'string','迭代步数:',...
    'fontsize',10,...
    'backgroundcolor',[0.75 0.75 0.75],...
    'position',[240 100 50 20]);
b1=uicontrol('parent',h0,...
    'units','points',...
    'tag','b1',...
    'style','pushbutton',...
    'string','最速下降法',...
    'backgroundcolor',[0.75 0.75 0.75],...
    'position',[250 60 60 20],...
    'callback',huidiao);
b2=uicontrol('parent',h0,...
    'units','points',...
    'tag','b2',...
    'string','关闭',...
    'style','pushbutton',...
    'backgroundcolor',[0.75 0.75 0.75],...
    'position',[250 30 60 20],...
    'callback','close');</P>
 楼主| 发表于 2004-6-1 18:50:33 | 显示全部楼层
<><FONT size=1><b><EM>实例97:共额梯度法</EM></b></FONT></P><>h0=figure('toolbar','none',...
    'position',[200 150 450 250],...
    'name','实例97');
h1=axes('parent',h0,...
    'position',[0.05 0.15 0.65 0.6],...
    'visible','off');
I=imread('abmatrix.bmp','bmp');
image(I)
axis off
huidiao=[...
        'a=[1 0 3 0;0 2 1 2;3 1 15 0;0 2 0 4;];,',...
        'b=[1 6 5 8]'';,',...
        'n=4;,',...
        'u=zeros(n,1);,',...
        'tic,',...
        '[x,k]=getd(a,b,n,u);,',...
        'time1=toc;,',...
        'T=num2str(time1);,',...
        'set(e1,''string'',[T,''秒'']);,',...
        'set(e2,''string'',num2str(k));,',...
        'msgbox([''X=['',num2str(x(1)),'' '',num2str(x(2)),'' '',num2str(x(3)),'','',num2str(x(4)),'']''],''方程组的解'');'];
t1=uicontrol('parent',h0,...
    'units','points',...
    'tag','t1',...
    'style','text',...
    'string','方程组如下:',...
    'fontsize',15,...
    'backgroundcolor',[0.75 0.75 0.75],...
    'position',[20 150 100 20]);
e1=uicontrol('parent',h0,...
    'units','points',...
    'tag','e1',...
    'style','edit',...
    'horizontalalignment','right',...
    'backgroundcolor',[1 1 1],...
    'position',[295 130 35 20]);
t2=uicontrol('parent',h0,...
    'units','points',...
    'tag','t2',...
    'style','text',...
    'string','计算时间:',...
    'fontsize',10,...
    'backgroundcolor',[0.75 0.75 0.75],...
    'position',[240 130 50 20]);
e2=uicontrol('parent',h0,...
    'units','points',...
    'tag','e2',...
    'style','edit',...
    'horizontalalignment','right',...
    'backgroundcolor',[1 1 1],...
    'position',[295 100 35 20]);
t2=uicontrol('parent',h0,...
    'units','points',...
    'tag','t2',...
    'style','text',...
    'string','迭代步数:',...
    'fontsize',10,...
    'backgroundcolor',[0.75 0.75 0.75],...
    'position',[240 100 50 20]);
b1=uicontrol('parent',h0,...
    'units','points',...
    'tag','b1',...
    'style','pushbutton',...
    'string','共轭梯度法',...
    'backgroundcolor',[0.75 0.75 0.75],...
    'position',[250 60 60 20],...
    'callback',huidiao);
b2=uicontrol('parent',h0,...
    'units','points',...
    'tag','b2',...
    'string','关闭',...
    'style','pushbutton',...
    'backgroundcolor',[0.75 0.75 0.75],...
    'position',[250 30 60 20],...
    'callback','close');</P>
 楼主| 发表于 2004-6-1 18:51:03 | 显示全部楼层
<><FONT size=1><b><EM>实例98:mewton迭代法</EM></b></FONT></P><>h0=figure('toolbar','none',...
    'position',[200 150 450 250],...
    'name','实例98');
h1=axes('parent',h0,...
    'position',[0.05 0.15 0.65 0.6],...
    'visible','off');
I=imread('fabmatrix.bmp','bmp');
image(I)
axis off
huidiao=[...
        'n=3;,',...
        'u=zeros(n,1);,',...
        'tic,',...
        '[x,k]=nnewton(u,n);,',...
        'time1=toc;,',...
        'T=num2str(time1);,',...
        'set(e1,''string'',[T,''秒'']);,',...
        'set(e2,''string'',num2str(k));,',...
        'msgbox([''X=['',num2str(x(1)),'' '',num2str(x(2)),'' '',num2str(x(3)),'']''],''方程组的解'');'];
t1=uicontrol('parent',h0,...
    'units','points',...
    'tag','t1',...
    'style','text',...
    'string','非线性方程组如下:',...
    'fontsize',15,...
    'backgroundcolor',[0.75 0.75 0.75],...
    'position',[20 150 150 20]);
e1=uicontrol('parent',h0,...
    'units','points',...
    'tag','e1',...
    'style','edit',...
    'horizontalalignment','right',...
    'backgroundcolor',[1 1 1],...
    'position',[295 130 35 20]);
t2=uicontrol('parent',h0,...
    'units','points',...
    'tag','t2',...
    'style','text',...
    'string','计算时间:',...
    'fontsize',10,...
    'backgroundcolor',[0.75 0.75 0.75],...
    'position',[240 130 50 20]);
e2=uicontrol('parent',h0,...
    'units','points',...
    'tag','e2',...
    'style','edit',...
    'horizontalalignment','right',...
    'backgroundcolor',[1 1 1],...
    'position',[295 100 35 20]);
t2=uicontrol('parent',h0,...
    'units','points',...
    'tag','t2',...
    'style','text',...
    'string','迭代步数:',...
    'fontsize',10,...
    'backgroundcolor',[0.75 0.75 0.75],...
    'position',[240 100 50 20]);
b1=uicontrol('parent',h0,...
    'units','points',...
    'tag','b1',...
    'style','pushbutton',...
    'string','Newton 迭代法',...
    'backgroundcolor',[0.75 0.75 0.75],...
    'position',[250 60 60 20],...
    'callback',huidiao);
b2=uicontrol('parent',h0,...
    'units','points',...
    'tag','b2',...
    'string','关闭',...
    'style','pushbutton',...
    'backgroundcolor',[0.75 0.75 0.75],...
    'position',[250 30 60 20],...
    'callback','close');</P>
 楼主| 发表于 2004-6-1 18:51:33 | 显示全部楼层
<><FONT size=1><b><EM>实例99:broyden迭代法</EM></b></FONT></P><>h0=figure('toolbar','none',...
    'position',[200 150 450 250],...
    'name','实例99');
h1=axes('parent',h0,...
    'position',[0.05 0.15 0.65 0.6],...
    'visible','off');
I=imread('fabmatrix.bmp','bmp');
image(I)
axis off
huidiao=[...
        'n=3;,',...
        'u=zeros(n,1);,',...
        'tic,',...
        '[x,k]=broyden(u,n);,',...
        'time1=toc;,',...
        'T=num2str(time1);,',...
        'set(e1,''string'',[T,''秒'']);,',...
        'set(e2,''string'',num2str(k));,',...
        'msgbox([''X=['',num2str(x(1)),'' '',num2str(x(2)),'' '',num2str(x(3)),'']''],''方程组的解'');'];
t1=uicontrol('parent',h0,...
    'units','points',...
    'tag','t1',...
    'style','text',...
    'string','非线性方程组如下:',...
    'fontsize',15,...
    'backgroundcolor',[0.75 0.75 0.75],...
    'position',[20 150 150 20]);
e1=uicontrol('parent',h0,...
    'units','points',...
    'tag','e1',...
    'style','edit',...
    'horizontalalignment','right',...
    'backgroundcolor',[1 1 1],...
    'position',[295 130 35 20]);
t2=uicontrol('parent',h0,...
    'units','points',...
    'tag','t2',...
    'style','text',...
    'string','计算时间:',...
    'fontsize',10,...
    'backgroundcolor',[0.75 0.75 0.75],...
    'position',[240 130 50 20]);
e2=uicontrol('parent',h0,...
    'units','points',...
    'tag','e2',...
    'style','edit',...
    'horizontalalignment','right',...
    'backgroundcolor',[1 1 1],...
    'position',[295 100 35 20]);
t2=uicontrol('parent',h0,...
    'units','points',...
    'tag','t2',...
    'style','text',...
    'string','迭代步数:',...
    'fontsize',10,...
    'backgroundcolor',[0.75 0.75 0.75],...
    'position',[240 100 50 20]);
b1=uicontrol('parent',h0,...
    'units','points',...
    'tag','b1',...
    'style','pushbutton',...
    'string','Broyden 迭代法',...
    'backgroundcolor',[0.75 0.75 0.75],...
    'position',[250 60 60 20],...
    'callback',huidiao);
b2=uicontrol('parent',h0,...
    'units','points',...
    'tag','b2',...
    'string','关闭',...
    'style','pushbutton',...
    'backgroundcolor',[0.75 0.75 0.75],...
    'position',[250 30 60 20],...
    'callback','close');</P>
 楼主| 发表于 2004-6-1 18:52:13 | 显示全部楼层
<><FONT size=1><b><EM>实例100:逆broyden迭代法</EM></b></FONT></P><>h0=figure('toolbar','none',...
    'position',[200 150 450 250],...
    'name','实例100');
h1=axes('parent',h0,...
    'position',[0.05 0.15 0.65 0.6],...
    'visible','off');
I=imread('fabmatrix.bmp','bmp');
image(I)
axis off
huidiao=[...
        'n=3;,',...
        'u=zeros(n,1);,',...
        'tic,',...
        '[x,k]=fbroyden(u,n);,',...
        'time1=toc;,',...
        'T=num2str(time1);,',...
        'set(e1,''string'',[T,''秒'']);,',...
        'set(e2,''string'',num2str(k));,',...
        'msgbox([''X=['',num2str(x(1)),'' '',num2str(x(2)),'' '',num2str(x(3)),'']''],''方程组的解'');'];
t1=uicontrol('parent',h0,...
    'units','points',...
    'tag','t1',...
    'style','text',...
    'string','非线性方程组如下:',...
    'fontsize',15,...
    'backgroundcolor',[0.75 0.75 0.75],...
    'position',[20 150 150 20]);
e1=uicontrol('parent',h0,...
    'units','points',...
    'tag','e1',...
    'style','edit',...
    'horizontalalignment','right',...
    'backgroundcolor',[1 1 1],...
    'position',[295 130 35 20]);
t2=uicontrol('parent',h0,...
    'units','points',...
    'tag','t2',...
    'style','text',...
    'string','计算时间:',...
    'fontsize',10,...
    'backgroundcolor',[0.75 0.75 0.75],...
    'position',[240 130 50 20]);
e2=uicontrol('parent',h0,...
    'units','points',...
    'tag','e2',...
    'style','edit',...
    'horizontalalignment','right',...
    'backgroundcolor',[1 1 1],...
    'position',[295 100 35 20]);
t2=uicontrol('parent',h0,...
    'units','points',...
    'tag','t2',...
    'style','text',...
    'string','迭代步数:',...
    'fontsize',10,...
    'backgroundcolor',[0.75 0.75 0.75],...
    'position',[240 100 50 20]);
b1=uicontrol('parent',h0,...
    'units','points',...
    'tag','b1',...
    'style','pushbutton',...
    'string','逆Broyden 迭代法',...
    'backgroundcolor',[0.75 0.75 0.75],...
    'position',[250 60 70 20],...
    'callback',huidiao);
b2=uicontrol('parent',h0,...
    'units','points',...
    'tag','b2',...
    'string','关闭',...
    'style','pushbutton',...
    'backgroundcolor',[0.75 0.75 0.75],...
    'position',[250 30 70 20],...
    'callback','close');</P>
您需要登录后才可以回帖 登录 | 注-册-帐-号

本版积分规则

小黑屋|手机版|Archiver|数学建模网 ( 湘ICP备11011602号 )

GMT+8, 2024-5-11 23:36 , Processed in 0.052267 second(s), 12 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表