MATLAB: We create plots from vectors x and y. Is the reverse possible? Can you first draw a curve using cursor in the figure palette and then create vectors x and y from it

MATLABmatlab plot

We create plots from vectors x and y. Is the reverse possible? Can you first draw a curve using cursor in the figure palette and then create vectors x and y from it?

Best Answer

figure
axis([0 10 0 10])
N = 5; % number of poins
title('click anywhere') ;
[x,y] = ginput(N) ;
plot(x,y) ;