MATLAB: Does the code not work in home edition

home editionImage Processing Toolbox

Like I said, my 11 year old program still worked in the trial version, with all the addons, but not in the home edition. From the answers I learned that my program used a command from a certain addon, Image Processing Toolbox, which I have then purchased. Now I get different errors. Can you tell me just by looking at the red error text what is the problem?
BLOCKPROC encountered an error while evaluating the user-supplied function handle, FUN.
The cause of the error was:
Undefined function 'le' for input arguments of type 'struct'.
Error in AdaptivelyThreshold (line 9)
s1=find(I<=T);
Error in blockprocFunDispatcher (line 13)
output_block = fun(block_struct);
Error in blockprocInMemory (line 80)
[ul_output fun_nargout] = blockprocFunDispatcher(fun,block_struct,...
Error in blockproc (line 242)
result_image = blockprocInMemory(source,fun,options);
Error in imOevelse8_1jeppe (line 14)
BW=blockproc(dI,[N,N],@AdaptivelyThreshold); %Blokvis processing med funktionen AdaptivelyThreshold

Best Answer

It passes a structure so you need to extract the data field. Change AdaptivelyThreshold (line 9) to this:
s1=find(I.data<=T);
Be aware that s1 can be a vector and I.data is a 2D array so you should probably do this:
[rows, columns] = find(I.data <= T);