matlab 判断语句假定x=12000matlab 语句为while x/10==fix(x/10)x=x/10;endx为什么无法 对进行重新赋值

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/13 01:30:24

matlab 判断语句假定x=12000matlab 语句为while x/10==fix(x/10)x=x/10;endx为什么无法 对进行重新赋值
matlab 判断语句
假定x=12000
matlab 语句为
while x/10==fix(x/10)
x=x/10;
end
x
为什么无法 对进行重新赋值

matlab 判断语句假定x=12000matlab 语句为while x/10==fix(x/10)x=x/10;endx为什么无法 对进行重新赋值
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.
>>