Integrating matrix minors without a loop

1 回表示 (過去 30 日間)
Juan
Juan 2013 年 8 月 22 日
I am trying to integrate all the 2x2 matrices A(i-1:1,j-1:j) without using a loop. Right now I am doing in a loop but it is extremely slow. The code is shown below:
A=rand(500);
t=linspace(0,1,500);
for i=2:length(A)
for j=2:length(A)
A_minor=A(i-1:i,j-1:j);
B(i,j)=trapz(t(j-1:j),trapz(t(i-1:i),A_minor));
end
end

回答 (0 件)

カテゴリ

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