フィルターのクリア

How do I work with a two dimensional array with for loops in MATLAB?

24 ビュー (過去 30 日間)
Pepa
Pepa 2011 年 1 月 24 日
How can I do two dimensions array using a FOR loop? Example:
P = {k,l,m,n};
L = 4;
for i=1:L
New(i) = P(i);
end
I don't know how can i do write that result was array in two dimension: New = {k,l,m,n;k,l,m,n;k,l,m,n;k,l,m,n};

採用された回答

Pepa
Pepa 2011 年 1 月 24 日
I did it:
for o = 1:O
zap(o,i) = varr(o);
end
F = length(zap);
for i = 1:K
for a = 1:F
kunn(a,j,i) = zap(a);
end
end

その他の回答 (1 件)

Sean de Wolski
Sean de Wolski 2011 年 1 月 24 日
Best way would be:
New = repmat(P,4,1);
You should also read up on indexing cell arrays.

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by