代码不运行,求助
功能用不动点迭代法求解方程
!迭代公式如图,标红的为自由赋值已知数](https://img-blog.csdnimg.cn/20191212150559141.png)
我的代码
function f=myf(x)
d=0;
a=0;
b=0.3;
r=1;
x =x(1);
y =x(2);
z =x(3);
f(1)=(2y(b+z)-y2-2*b*z-b2)^0.5-x;
f(2)=(r2-(x-a-r)2)^0.5-y;
f(3)=x*cot(pi/2-d-asin(y/r))-b+y-z;
end
function [t,n]=Fixedpoint(myf,x0,eps)
%不动点迭代法求非线性方程组的一个解
%初始迭代向量:x0
%迭代精度:eps
%解向量:t
%迭代步数:n
if nargin==2
eps=1.0e-6;
end
x0=transpose(x0);
n=1;
tol=1;
while tol>eps
t=subs(myf,findsym(myf),x0);
tol=norm(t-x0);
n=n+1;
x0=t;
if(n>10000)
disp('bu shou lian ');
return;
end
end
输入