Hello, I need to reassign selected plotted points to NaN values and update my graph so that they no longer show up on the graph but I am having trouble getting my code to work. I need to compare x and y values between 2 different sized arrays. If the coordinates compared match I need those coordinates to be sent back to the original matrix as NaN values and then have the current figure updated accordingly and those points no longer showing on the graph. Below is the string of code I am working with. Any help would be greatly appreciated. X and Y are the where the orignial points are stored while HS_elim is the array that contains the points that should be eliminated.
LengthofTC4 = length(HS_elim); for i = 1:n for j = 1:LengthofTC4 if x(i) == HS_elim(j,1) || y(i) == HS_elim(j,2) x(i) = NaN; y(i) = NaN; refreshdata(CTR) drawnow end end end
Best Answer