作业帮 > 综合 > 作业

matlab 判断语句

来源:学生作业帮 编辑:拍题作业网作业帮 分类:综合作业 时间:2024/04/30 12:49:40
matlab 判断语句
假定x=12000
matlab 语句为
while x/10==fix(x/10)
x=x/10;
end
x
为什么无法 对进行重新赋值
There is nothing wrong. I ran the program. "x" was 12 when the program stopped.
Program:
x=12000 % initialization.
while x/10==fix(x/10) % while loop.
x=x/10
end
x % output result.
Output:
x =
12000 % initialization.
x =
1200 % first round in the while loop.
x =
120 % second round in the while loop.
x =
12 % third round in the while loop.
x =
12 % last line of the program, output result.