I am trying to plot something in Matlab. First I am ploting some 3d points and then I execute the hold command. Next I plot some other plots. I want just my first plot to be remembered and never cleard. The other plots will always we deleted after plot command executes.
Example:
plot3(X,Y,Z,'ro');
hold;
% now I will plot a lot of other plots here in every iteration. % plot number 2
[x,y] = meshgrid(X,Y);
z = a.*x + b.*y + c';
mesh(x,y,z);
% plot number 3 - plot number 2 should be deleted
[x,y] = meshgrid(X,Y);
z = a.*x + b.*y + c';
mesh(x,y,z);
% plot number 4 - plot number 3 should be deleted
[x,y] = meshgrid(X,Y);
z = a.*x + b.*y + c';
mesh(x,y,z);
... and so on. So, I want just the first plot to be remembered.
I am trying to do it but I cant find a solution up to now.Thnx a lot :).
EDITED:
I will call this function from c#:
function [] = PlotMatlab(a,b,c,X,Y,Z )
[x,y] = meshgrid(X,Y);
z = a.*x + b.*y + c;
mesh(x,y,z);
end
...so whenever I call this function from c# I need the previous plot (mesh) to be deleted