Prev: Edit mexopts.bat to compile mex file with OpenMP
Next: Powers are slow, multiplies fast; optimized badly?
From: Roger Stafford on 19 Jul 2010 14:57 "Roger Stafford" <ellieandrogerxyzzy(a)mindspring.com.invalid> wrote in message <i225p2$9bs$1(a)fred.mathworks.com>... > You could also do it this way: > > [m,n] = size(A); > B = A(floor((p:p*(m+1)-1)/p),floor((q:q*(n+1)-1)/q)); > > where single elements in A are to be expanded into a p x q size block. > > Roger Stafford - - - - - - - Or along the same lines but possible faster: B = A( repmat(1:size(A,1),p,1) , repmat(1:size(A,2),q,1) ); Roger Stafford
From: Emily Bauner on 19 Jul 2010 18:02 Thank you so much, guys, for those fast replies. It's exactly what I needed - you're awesome!
First
|
Prev
|
Pages: 1 2 Prev: Edit mexopts.bat to compile mex file with OpenMP Next: Powers are slow, multiplies fast; optimized badly? |