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/16 16:27:05
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)