Whileloop output calculation?

4 次查看(过去 30 天)
Entle
Entle 2023-5-21
回答: Dongyue 2023-5-25
Given the matlab code below
x1=15; while x1>10 x1=x1*(x1+1); end disp(x1)
State the output that the code will yield.

回答(1 个)

Dongyue
Dongyue 2023-5-25
The condition x1>10 is always true, making this while loop infinite. Consequently, the loop will continue indefinitely without producing any output since the disp(x1) command will never execute.

类别

Help CenterFile Exchange 中查找有关 Desktop 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by