problem with fuction handle evaluation in blockproc

1 view (last 30 days)
I get the following error Function BLOCKPROC encountered an error while evaluating the user supplied function handle, FUN.
The cause of the error was:
Undefined variable block_struct.
Error in myfunction>calc (line 18) [row col]=block_struct.location;
I cant find why this happens.Is something wrong with handle creation?
function [ macroblock ] = myfunction( reference_frame,target_frame )
fun = @(block_struct,reference_frame) calc;
macroblock=blockproc(target_frame,[16 16],fun,'PadPartialBlocks',true)
end
function calc(block_struct,reference_frame
[row col]=block_struct.location;
for i=1:16 %search constant
for j=1:16
for p=1:16
for q=1:16
% SAD(i,j)=abs(struct.data(p,q,:)-reference_frame((row+p-1)+i,(col+q-1)+j,:))
end
end
end
end
end

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!