[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: loops over a 3d array
From: |
veryhappy |
Subject: |
Re: loops over a 3d array |
Date: |
Tue, 29 Jun 2010 03:23:34 -0700 (PDT) |
At first glance you can replace it for
Hx = rand(n); % n natural number
Hy = rand(n);
Hz = rand(n);
u = rand(n,n,n);
us = zeros(n,n,n);
for k = 1:n
for j = 1:n
us(:,:,k) = us(:,:,k)+Hz(k,j)*(Hy*u(:,:,j)*Hx');
end
end
wich will help you a little. I will look at it with more detail later
--
View this message in context:
http://octave.1599824.n4.nabble.com/loops-over-a-3d-array-tp2271875p2271983.html
Sent from the Octave - General mailing list archive at Nabble.com.