THe Error and warning occurred while onnecting arduino: Warning: Unsuccessful read: A timeout occurred before the Terminator was reached. Error using arduino (line 101) Connection unsuccessful, please make sure that the Arduino is powered on, running either srv.pde, adiosrv.pde or mororsrv.pde, and that the board is connected to the indicated serial port. You might also try to unplug and re-plug the USB cable before attempting a reconnection.
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