in the find ball script i get error on the 52 line that is after the else, kindly answer this. I am using R2009a version
%% Find center
% Now we are using REGIONPROPS to extract the centroid of the group of
% pixels representing the ball.
s = regionprops(ball1, {'centroid','area'});
if isempty(s)
error('No ball found!');
else
[~, id] = max([s.Area]);
hold on, plot(s(id).Centroid(1),s(id).Centroid(2),'wp','MarkerSize',20,'MarkerFaceColor','r'), hold off
disp(['Center location is (',num2str(s(id).Centroid(1),4),', ',num2str(s(id).Centroid(2),4),')'])
end
Comment only