Filter löschen
Filter löschen

Using for loops for a matrix

1 Ansicht (letzte 30 Tage)
Liz
Liz am 30 Nov. 2020
Beantwortet: Ameer Hamza am 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?

Akzeptierte Antwort

Ameer Hamza
Ameer Hamza am 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

Weitere Antworten (0)

Kategorien

Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange

Produkte


Version

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by