Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

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


Math Forum » Discussions » Software » comp.soft-sys.matlab

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

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Michail

Posts: 3
Registered: 7/8/14
Re: Access an array in blocks
Posted: Jul 14, 2014 5:29 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"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



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.