Whileloop output calculation?

조회 수: 1 (최근 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.
  댓글 수: 3
Walter Roberson
Walter Roberson 2023년 5월 21일
control-c maybe?
Torsten
Torsten 2023년 5월 21일
German keyboard.

댓글을 달려면 로그인하십시오.

답변 (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