Matlab迭代这个程序有些错误,请大家帮我修改修改function Martin(a,b,c,N)f=@(x,y)(y-sign(x)*sqrt(abs(b*x-c)));g=@(x)(a-x);m=[0;0];for n=1:Nm(:,n+1)=[f(m(1,n),m(2,n),g(m(1,n)))];endplot(m(1,:),m(2,:),'kx');axis equal;
来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/25 14:53:03
Matlab迭代这个程序有些错误,请大家帮我修改修改function Martin(a,b,c,N)f=@(x,y)(y-sign(x)*sqrt(abs(b*x-c)));g=@(x)(a-x);m=[0;0];for n=1:Nm(:,n+1)=[f(m(1,n),m(2,n),g(m(1,n)))];endplot(m(1,:),m(2,:),'kx');axis equal;
Matlab迭代
这个程序有些错误,请大家帮我修改修改
function Martin(a,b,c,N)
f=@(x,y)(y-sign(x)*sqrt(abs(b*x-c)));
g=@(x)(a-x);
m=[0;0];
for n=1:N
m(:,n+1)=[f(m(1,n),m(2,n),g(m(1,n)))];
end
plot(m(1,:),m(2,:),'kx');
axis equal;
Matlab迭代这个程序有些错误,请大家帮我修改修改function Martin(a,b,c,N)f=@(x,y)(y-sign(x)*sqrt(abs(b*x-c)));g=@(x)(a-x);m=[0;0];for n=1:Nm(:,n+1)=[f(m(1,n),m(2,n),g(m(1,n)))];endplot(m(1,:),m(2,:),'kx');axis equal;
function Martin(a,b,c,N)
f=@(x,y)(y-sign(x)*sqrt(abs(b*x-c)));
g=@(x)(a-x);
m=[0;0];
for n=1:N
m(:,n+1)=[f(m(1,n),m(2,n)),g(m(1,n))]';
end
plot(m(1,:),m(2,:),'kx');
axis equal;
-------------------------------
Martin(5,4,3,10)