MATLAB: Trouble on finding line segment show too many input arguments using callback function

linesegment callback function

i got this result after FindSegment (1,1)
Error in FindSegment/myCallBack (line 60)
myplot();
Error while evaluating figure WindowButtonMotionFcn
Undefined function or variable 'myplot'.
Error in FindSegment/myCallBack (line 60)
myplot();
Error while evaluating figure WindowButtonMotionFcn
Undefined function or variable 'myplot'.
Error in FindSegment/myCallBack (line 60)
my full code is in this attachment

Best Answer

You call myplot() but only myplots() is defined in the code. Pick one of the names and use that one name everywhere - either myplot or myplots but not both.