Displaying a string using a variable inside a loop
조회 수: 1 (최근 30일)
이전 댓글 표시
HI, I want to ask user for some values.
The prompt should be something like this:
Which is the number 1?:
Which is the number 2?:
Which is the number 3?:
...
The code is here:
for i=1:a
in=input('Wich is the number ' disp(i) '?:');
eval (['b' num2str(i) '=in' ';']);
end
But it dont allow me to use the disp() inside the input, any idea?
댓글 수: 0
채택된 답변
Azzi Abdelmalek
2012년 8월 31일
for i=1:a
in=input(['Wich is the number ' num2str(i) '?:']);
eval (['b' num2str(i) '=in' ';']);
end
댓글 수: 0
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!