Stacking arrays in a matrix

2 ビュー (過去 30 日間)
Tim
Tim 2012 年 10 月 12 日
Hi all,
I've got a script that basically looks like this:
blabla = [ ];
while count <=6
if
for i=1:6
blabla = [blabla,n1.bla];
end
else
end
end
As you can see, inside my for-loop I am stacking data in an array.
However, every time the while-loop runs, I want the array data to be added to a matrix, to get a 6-by-6 matrix in the end.
How can should do this? I was guessing something like
matrixblabla= [matrixblabla;blabla]
but I can't get it to work.
Thanks in forward.
Cheers, T.

回答 (1 件)

Azzi Abdelmalek
Azzi Abdelmalek 2012 年 10 月 12 日
編集済み: Azzi Abdelmalek 2012 年 10 月 12 日
blabla=[]; %iniitialize
for i=1:6
blabla = [blabla,n1.bla];
end
I think what you've posted is not enough

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by