how can i make this loop work

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

답변 (1개)

madhan ravi
madhan ravi 2020년 7월 11일

0 개 추천

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

hedie adine zade
hedie adine zade 2020년 7월 12일
wow thank you soooo much

이 질문은 마감되었습니다.

태그

질문:

2020년 7월 11일

마감:

2021년 8월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by