nxm user defined array

4 vues (au cours des 30 derniers jours)
Ana Jurado
Ana Jurado le 22 Fév 2020
Commenté : Ana Jurado le 22 Fév 2020
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
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?
Ana Jurado
Ana Jurado le 22 Fév 2020
it doesn't say :/

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Matrix Indexing dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by