suppose i use for loop and this is code
N=20;area=100;X=rand(1,N)*area;Y=rand(1,N)*area;htext=[];for i1=1:2 for i=1:N htext(i)=text(X(i),Y(i),num2str(i),'fontsize',20); hold on end end delete(htext)for ii=1:5 delete(htext(ii)); end
now error is come when delete(htext) is execute plz give me some solution.
beacuse it show the message when cursor move on the htext variable 'htext size will be change every iteration '.how to delete hetxt value in for loop and out of for loop
Best Answer