how to make input function that displays text according to loop:
i.e. for i=1:30
g=input('enter "/i/"th line');
end
and it would display:
enter 1th line
enter 2th line
enter 3th line etc.....

 Respuesta aceptada

Chaowei Chen
Chaowei Chen el 21 de Ag. de 2011

1 voto

for i=1:30
g=input(['enter ' int2str(i) ' th line']);
end

1 comentario

John D'Errico
John D'Errico el 6 de Jul. de 2019
+1. But to be picky ... you needed to write it to know that it should be '1st', '2nd', '3rd', etc. ;-)

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre MATLAB en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 21 de Ag. de 2011

Comentada:

el 6 de Jul. de 2019

Community Treasure Hunt

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

Start Hunting!

Translated by