User Input of Numerical Value

조회 수: 1 (최근 30일)
manish sharma
manish sharma 2012년 6월 30일
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!

채택된 답변

Walter Roberson
Walter Roberson 2012년 6월 30일
for K = 1 : 5
x(K) = input( sprintf('Enter the dectector%d x coordinate', K) );
end
  댓글 수: 1
manish sharma
manish sharma 2012년 6월 30일
Thanks Walter. That's exactly what I need.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by