matlab Input argument "x" is undefined.function y=m(x);y=x.^3-2.*x-5;function y=m1(x);y=3.*x.^2-2;x=3;i=0;while i1e-5x=y;else breakendi=i+1;endx是这样的.出现了?Input argument "x" is undefinedX是用FUNCTION定义过的,怎么回事.能解决
来源:学生作业帮助网 编辑:六六作业网 时间:2024/10/03 19:26:32
matlab Input argument "x" is undefined.function y=m(x);y=x.^3-2.*x-5;function y=m1(x);y=3.*x.^2-2;x=3;i=0;while i1e-5x=y;else breakendi=i+1;endx是这样的.出现了?Input argument "x" is undefinedX是用FUNCTION定义过的,怎么回事.能解决
matlab Input argument "x" is undefined.
function y=m(x);
y=x.^3-2.*x-5;
function y=m1(x);
y=3.*x.^2-2;
x=3;i=0;
while i1e-5
x=y;
else
break
end
i=i+1;
end
x
是这样的.出现了?Input argument "x" is undefined
X是用FUNCTION定义过的,怎么回事.能解决再加5分.
matlab Input argument "x" is undefined.function y=m(x);y=x.^3-2.*x-5;function y=m1(x);y=3.*x.^2-2;x=3;i=0;while i1e-5x=y;else breakendi=i+1;endx是这样的.出现了?Input argument "x" is undefinedX是用FUNCTION定义过的,怎么回事.能解决
没有错啊,我在我的MATLAB2010a的版本上调试了,没错,结果是
x =
2.0946
我估计你会出错应该是你的function文件在保存的时候不要修改文件名,分别是m和m1,因为你在下面函数定义是这样的:
function y=m(x)
y=x.^3-2*x-5;
故,文件名不能改,否则也就是说你的x并没有定义.把你的邮箱给我,我把m文件发给你!