matlab 判断语句假定x=12000matlab 语句为while x/10==fix(x/10

发布时间:2021-02-26 01:56:09

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
endx % 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.
>>
以上问题属网友观点,不代表本站立场,仅供参考!