フィルターのクリア

I want to generate 2000 matrices for statistical analysis, when I put m=2 my code works but for greater then m it gives error like that "Error using ' Transpose on ND array is not defined. Use PERMUTE instead." see my code

2 ビュー (過去 30 日間)
clc
tic
m=3;
A = randn(3,3, m);
J=blkdiag(eye(3),-eye(2));
B=rand(2,3);
C=hilb(2);
for j=1:m
A(:,:,j) = 0.5*(A(:,:,j)+A(:,:,j)');
A(:,:,j) = A(:,:,j) + 5*eye(3);
K=[A(:,:,j),B';B,C];
L1(:,:,j) = chol(A(:,:,j),'lower');
g(:,:,j)=L1(:,:,j)';
I(:,:,j)=inv(g(:,:,j));
L2(:,:,j)=B*I(:,:,j);
B(:,:,j)=L2(:,:,j)*L1(:,:,j)';
G(:,:,j)=(C+L2(:,:,j)*L2(:,:,j)');
L3(:,:,j) = chol(G(:,:,j),'lower');
L(:,:,j)=[L1(:,:,j) zeros(3,2);L2(:,:,j) L3(:,:,j)];
end
toc

採用された回答

Matt J
Matt J 2018 年 10 月 30 日
編集済み: Matt J 2018 年 10 月 30 日
Maybe just do
B=L2(:,:,j)*L1(:,:,j)';

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeHypothesis Tests についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by