用matlab 编写命令文件:计算1+3+······+2n-1<2000时的最大n值。

如题所述

编写M文件:
s=0;
n=0;
while s<2000
n=n+1;
i=2*n-1;
s=s+i;
end
n=n-1
运行结果:
44
温馨提示:答案为网友推荐,仅供参考
相似回答