Integrating matrix minors without a loop

14 visualizaciones (últimos 30 días)
Juan
Juan el 22 de Ag. de 2013
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

Respuestas (0)

Categorías

Más información sobre Loops and Conditional Statements en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by