Whileloop output calculation?
조회 수: 9 (최근 30일)
이전 댓글 표시
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
답변 (1개)
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.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!