帮忙分析一下这个matlab函数 不知道怎么运行,也不懂得啥意思

functionA=df(x)n=3;A=zeros(n,n);A(1,1)=2*x(1)-10;A(1,2)=2*x(2);A(1,3)=1;A(2,1)=x(2).^... function A=df(x)
n=3;
A=zeros(n,n);
A(1,1)=2*x(1)-10;
A(1,2)=2*x(2);
A(1,3)=1;
A(2,1)=x(2).^2;
A(2,2)=2*x(1)*x(2);
A(2,3)=2*x(3)-2;
A(3,1)=2*x(1);
A(3,2)=2*x(2)-3;
A(3,3)=2*x(3);

function r=f(x)
n=3;
r=zeros(n,1);
r(1)=x(1).^2-10*x(1)+x(2).^2+x(3)+7;
r(2)=x(1)*x(2).^2+x(3).^2-2*x(3);
r(3)=x(1).^2+x(2).^2-3*x(2)+x(3).^2;

function [U,st]=fbroyden(X,n)
k=0;
e=ones(n,1);
B=inv(df(X));
while norm(e,2)>1e-6
k=k+1;
X1=X;
dX=B*f(X);
X=X-dX;
p=X-X1;
q=f(X)-f(X1);
B=B+((p-B*q)*p'*B)/(p'*B*q);
e=dX;
end
U=X;
st=k;

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');
展开
 我来答
WM_THU
2013-07-17 · TA获得超过7165个赞
知道大有可为答主
回答量:4285
采纳率:80%
帮助的人:4323万
展开全部

您确定这是一段程序?

我看到了三个函数和一段脚本。

其中脚本需要一幅图fabmatrix.bmp才能正常运行。

我把他们打包放在这里。


已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式