Using for loops for a matrix

1 次查看(过去 30 天)
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?

采纳的回答

Ameer Hamza
Ameer Hamza 2020-11-30
Just use a for-loop. For example
M = rand(10, 40);
for i = 1:size(M,1)
figure();
plot(M(i,:));
end

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Loops and Conditional Statements 的更多信息

产品


版本

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by