clf axis([0 10 0 10]) hold on %% Initially, the list of points is empty. xy = []; n = 0; %% Loop, picking up the points. disp('Left mouse button picks points.') disp('Right mouse button picks last point.') but = 1; while but == 1 [xi,yi,but] = ginput(1); plot(xi,yi,'ro') n = n+1; xy(:,n) = [xi;yi]; end [T,ind] = sort(xy(1,:)); Y = xy(2,ind); %% Interpolate with a spline % To Do %% Plot the interpolated curve. % To Do hold off