Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Access an array in blocks
Replies: 1   Last Post: Jul 14, 2014 5:29 AM

 Messages: [ Previous | Next ]
 Michail Posts: 5 Registered: 7/8/14
Re: Access an array in blocks
Posted: Jul 14, 2014 5:29 AM

"Michail " <mixalis@eminidis.com> wrote in message <lptjfa\$5o6\$1@newscl01ah.mathworks.com>...
> Hello everyone,
>
>
> i want to access an 512x512 array in 4x4 blocks, any ideas??
>
>
> Thanks!!!

I think i found a way to do it but i have a dimentions mismatch problem
the array i want to work on is fdif and through it i need to create 3 new arrays(S, fdifmin,fmin).
k = 1;
l = 4;
for i=1:128
for j=1:128
if log2(max(fdif(k:l,k:l)) - min(fdif(k:l,k:l))) == 0
S(i,j) = 0;
fdifmin(i,j) = min(fdif(k:l,k:l));
fmin(i,j) = log2(max(fdif(k:l,k:l)) - min(fdif(k:l,k:l)));
k = k+4;
l = l+4;
elseif log2(max(fdif(k:l,k:l)) - min(fdif(k:l,k:l))) == 1
S(i,j) = 0;
fdifmin(i,j) = min(fdif(k:l,k:l));
fmin(i,j) = log2(max(fdif(k:l,k:l)) - min(fdif(k:l,k:l)));
k = k+4;
l = l+4;
else
S(i,j) = log2(max(fdif(k:l,k:l)) - min(fdif(k:l,k:l)) -1);( DIMENTIONS MISMATCH)
fdifmin(i,j) = min(fdif(k:l,k:l));
fmin(i,j) = log2(max(fdif(k:l,k:l)) - min(fdif(k:l,k:l)));
k = k+4;
l = l+4;
end
end
end

Date Subject Author
7/13/14 Michail
7/14/14 Michail