Integrating matrix minors without a loop

1 次查看(过去 30 天)
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 CenterFile Exchange 中查找有关 Loops and Conditional Statements 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by