Borrar filtros
Borrar filtros

User Input of Numerical Value

1 visualización (últimos 30 días)
manish sharma
manish sharma el 30 de Jun. de 2012
Hi,
I am using:
x = input('Enter the detector x coordinate')
but now I want a user input each time the loop runs, in the following way:
for i=1, it should say: Enter the detector1 x coordinate
for i=2, it should say: Enter the detector2 x coordinate
...etc etc.
Please help.
Thanks!

Respuesta aceptada

Walter Roberson
Walter Roberson el 30 de Jun. de 2012
for K = 1 : 5
x(K) = input( sprintf('Enter the dectector%d x coordinate', K) );
end
  1 comentario
manish sharma
manish sharma el 30 de Jun. de 2012
Thanks Walter. That's exactly what I need.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Matrix Indexing 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