Insert an index in a for loop

1 次查看(过去 30 天)
Hi,
I need to create a for loop like
for i=1:size(A,1)
Matrix(index)(:,i)= expression
end
I want to get a list of matrix like
Matrix1,Matrix2,Matrix3,Matrix4...
is that possible?

采纳的回答

KSSV
KSSV 2019-4-1
编辑:KSSV 2019-4-1
A = zeros(2,2,10) ;
for i = 1:10
A(:,:,i) = rand(2) ;
end
A(:,:,1)
A(:,:,3)
In your case follow:
for i=1:size(A,1)
Matrix(:,:,i)= expression ;
end

更多回答(0 个)

类别

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

标签

Community Treasure Hunt

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

Start Hunting!

Translated by