how can i make this loop work
Informazioni
Questa domanda è chiusa. Riaprila per modificarla o per rispondere.
Mostra commenti meno recenti
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
Risposte (1)
madhan ravi
il 11 Lug 2020
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 Commento
hedie adine zade
il 12 Lug 2020
Questa domanda è chiusa.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!