I have the following function, provided that the code for pdist2
is here.
function m = pixel_minimize_distance(x,y)
maximum = (sum(sum(pdist2(x,y))));
[r c] = size(y);
initialValue = y(1,1);
for i=1:r
for j=1:c
o = y(i,j);
y(i,j) = 0;
sum2 = (sum(sum(pdist2(x,y))));
if sum2 >= maximum
if o ~= 0
maximum = sum2;
m = o;
end
maximum = maximum;
m = initialValue;
end
y(i,j)=o;
end
end
end
Now, when I try to run the function, I don't get an output as shown below:
>> A=[0 0 0; 0 0 0];
>> B=[1 1 1; 1 1 1];
>> pixel_minimize_distance(A,B)
How can I solve this issue?
Thanks.