How to store 1x3 vectors in (n,m) position of 2D matrix in a for loop ?

1 回表示 (過去 30 日間)
Ole
Ole 2015 年 2 月 28 日
編集済み: Ole 2015 年 2 月 28 日
How to build nested array of 1x3 vectors in the (n,m) posision of 2D matrix in a for loop?
And then how to access the n,m vector ? Is there a better way that this below.
for n =1:2
for m =1:3
v = [n,m,n]' % test vector to be stored
A(3*n-2:3*n,m) = v;%
end
end
n =2;m=3;
v = A(3*n-2:3*n,m); %
A
v

回答 (0 件)

カテゴリ

Help Center および File ExchangeMultidimensional Arrays についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by