MATLAB: Deleting Background Image After Interpolation

interpolation

Dear All,
As the question suggests, I need to know how to clear the background image after I plotted the interpolated curve.
if true
rgb = imread('leaf.jpg');
figure
imshow(rgb);
axis([0 500 0 500]);
hold on;
xy = [];
disp('Left mouse button picks points.')
disp('Right mouse button picks last point.')
p = 1; %Loop flag
n = 0; %Incrementer for points.
while p == 1
[xi,yi,p] = ginput(1);
plot(xi,yi,'ro')
n=n+1;
xy(:,n) = [xi,yi];
end
%Interpolate with a Spline curve.
t = 1:n;
ts = 1:0.1:n;
xys = spline(t,xy,ts);
% Plot the interpolated curve.
plot(xys(1,:),xys(2,:),'b-');
hold off
clf(rgb)
% code
end
Thanks to all! 🙂

Best Answer

Not sure what that means, but you can use delete() or clear() to get rid of variables.
Related Question