Borrar filtros
Borrar filtros

Whileloop output calculation?

1 visualización (últimos 30 días)
Entle
Entle el 21 de Mayo de 2023
Respondida: Dongyue el 25 de Mayo de 2023
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 comentarios
Walter Roberson
Walter Roberson el 21 de Mayo de 2023
control-c maybe?
Torsten
Torsten el 21 de Mayo de 2023
German keyboard.

Iniciar sesión para comentar.

Respuestas (1)

Dongyue
Dongyue el 25 de Mayo de 2023
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.

Categorías

Más información sobre Specialized Power Systems en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by