"Matthew Balint" <email@example.com> wrote in message news:firstname.lastname@example.org... > dpb <email@example.com> wrote in message <firstname.lastname@example.org>... >> On 9/13/2013 3:03 PM, Matthew Balint wrote:
> I tried to use the blockprock function, and I don't understand the 'fun' > function handle.
It is the function that you want to be applied to each block.
> It instructed me to use 'block_struct' and 'block_struct.data' and I have > no idea what those are or how to use them.
See the Definitions section of the BLOCKPROC documentation page for information about the fields contained in the block_struct struct array.
My guess is that BLOCKPROC passes that structure instead of just the specified piece of your matrix into the function because for image processing applications that extra information may be useful. The data field of that struct array contains just the specified piece of your matrix.
> My array is simply numeric and I thought block_struct.data was an array > that contained multiple values, not just numeric values?
BLOCKPROC will call this function four times: once with the upper left 2-by-2 block of M stored in block_struct.data, once with the upper-right, once with the lower-left, and once with the lower-right.