Dear all, I would like to count the points outside the bands as shown
in blue line which is 10% band in both side. The code is like this
ndata = length(data);X = linspace(0, 1, ndata);%ndata is number of point
x = data/max(data); % data is normalized to 1
y = dy/max(dy);xL = linspace(0.1,1, ndata); xL = xL(:); % lower line of band
yL = linspace(0,0.9, ndata); yL = yL(:);xU = linspace(0,0.9, ndata); xU = xU(:);yU = linspace(0.1,1, ndata); yU = yU(:);hold onplot(x, y, '.k')plot(X, X, '-k'); X = X(:); % 45 degree angled line
plot(xL, yL, '-B'); % lower line of bandplot(xU, yU, '-B'); % upperline of band
pnts = [x y];d1 = sqrt((x-X).^2+(y-X).^2); % calculation of distance between points
idout = find(d1>0.10); % here is the 10% band width and finding distance greater than 0.1
xOut = x(idout);yOut = y(idout);plot(xOut, yOut, '.r'); Want to display points outside the band in redhold off
However I got something like this
</matlabcentral/answers/uploaded_files/18174/After.png> this is not the correct one. I think there is some algorithm problem or problem in handling code. Could any one help me in this regard. In fact, I just want the number of points oun side the band rather than plot. Plot is just the confirming.
Thanks in advance.
Best Answer