How do I record a whole row of one array into another a specific row of another array

1 回表示 (過去 30 日間)
Stuart Ellison
Stuart Ellison 2017 年 7 月 14 日
回答済み: Jan 2017 年 7 月 14 日
For example I have a loop in my code that produces an array
e.g
N+1 = [11 12 13 14 15]
N+2 = [23 76 45 23 76]
N+3 = [76 21 23 12 23]
I would like to record all of these N+n results as they are calculated. into one big array
e.g
A =
11 12 13 14 15
23 76 45 23 76
76 21 23 12 23

回答 (1 件)

Jan
Jan 2017 年 7 月 14 日
A = zeros(10, 5);
for k = 1:10
A(k, :) = (1:5) + k * 10;
end

カテゴリ

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