Matrix splitting to overcome "array exceeds maximum array size"?

I currently have:
N=[x1,y1,z1;x2,y2,z2;...;xn,yn,zn];
K=[kx1,ky1,kz1;kx2,ky2,kz2;...;kxn,kyn,kzn];
S=N*K';
S=[K(:,1),K(:,2),S'];
However due to the size of N and K being 78596x3 and 361201x3 respectively the error message "array exceeds maximum array size" appears when calculating S.
Therefore I want to create a loop to calculate S for sections of K to prevent this. What is the best way to do this.

2 件のコメント

bio lim
bio lim 2015 年 7 月 10 日
What is Sn'?
mfas
mfas 2015 年 7 月 10 日
Sorry, small typo, should be the transpose of S (S').

サインインしてコメントする。

 採用された回答

Guillaume
Guillaume 2015 年 7 月 10 日
編集済み: Guillaume 2015 年 7 月 10 日

0 投票

Something like this:
subklength = 100; %whatever you want
transK = K';
for kstart = 1 : subklength : size(k, 1)
S = N * transK(:, kstart : min(end, kstart+subklength-1))'; %S for section of K
%do something with S
end

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeMatrix Indexing についてさらに検索

質問済み:

2015 年 7 月 10 日

コメント済み:

2015 年 7 月 10 日

Community Treasure Hunt

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

Start Hunting!

Translated by