Using for loops for a matrix
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Liz
le 30 Nov 2020
Réponse apportée : Ameer Hamza
le 30 Nov 2020
The question is:
'Using a for loop, create as many figure windows as there are rows in the matrix and plot the numbers from each row in a seperate figure window.'
I have a matrix with four rows, how do I go about doing this?
0 commentaires
Réponse acceptée
Ameer Hamza
le 30 Nov 2020
Just use a for-loop. For example
M = rand(10, 40);
for i = 1:size(M,1)
figure();
plot(M(i,:));
end
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Loops and Conditional Statements 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!