I wrote a function shown below. When I want to enter my input (xnew,ynew) instead of (x,y) , this function would not work. I understand the reason (because my code specifies (x,y)), but do not know how to fix it. Please help. Thank you!
line(x, y, 'Color', 'r', 'LineStyle', '--', 'LineWidth', 2)