> for i in range(dim):
>    for j in range(dim):
>        a[i,j,0] = a[i,j,1]
>        a[i,j,2] = a[i,j,0]
>        a[i,j,1] = a[i,j,2]

> for i = 1:dim
>    for j = 1:dim
>        a(i,j,1) = a(i,j,2);
>        a(i,j,2) = a(i,j,1);
>        a(i,j,3) = a(i,j,3);
>    end
> end

Hi,

The two loops are not the same.
As David stated, with JIT, the loops may be vectorized by Matlab on the fly.

-- 
Information System Engineer, Ph.D.
Website: http://matthieu-brucher.developpez.com/
Blogs: http://matt.eifelle.com and http://blog.developpez.com/?blog=92
LinkedIn: http://www.linkedin.com/in/matthieubrucher
_______________________________________________
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to