Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
how can i make this loop work
조회 수: 1 (최근 30일)
이전 댓글 표시
function gpaname
x = zeros(1,10);
y = zeros(1,10);
for i=1:10
x(i) = input('please enter your name=' , 's');
end
for j=1:10
y(j) = ('please enter your GPA=');
end
result = [x' , y'];
disp(result);
end
댓글 수: 0
답변 (1개)
madhan ravi
2020년 7월 11일
function gpaname
[x, y]= deal(cell(10,1));
for ii = 1:10
x{ii} = input('please enter your name=' , 's');
y{ii} = input('please enter your GPA=');
end
result = [x , y];
disp(result);
end
댓글 수: 1
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!