User Input of Numerical Value

3 次查看(过去 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

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 MATLAB 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by