nxm user defined array
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
while strcmp(Str,'yes')
n = input('number or rows');
m = input('number of columns');
A = zeros(n,m);
for i = 1:n
for j = 1:m
A(i,j)= i;j;
end
end
end
i am trying to make an array where i first ask the user to enter n and m and then use a for loop to make the array, can someone explain and help me figure out what i did and what i need to do to make it work? thanks
11 commentaires
Image Analyst
le 22 Fév 2020
Put the user-entered numbers into the array in what order? Row by row, or column by column? Like what gets filled first: the first row, or the first column?
Réponses (0)
Voir également
Catégories
En savoir plus sur Matrix Indexing dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!