matlab - Identify/Extract identical curves from a multicurve plot plot -
lets have plot containing 300 curves. there method in matlab 2014a can identify curves identical each other? more specific, if have 10 curves on single figure, curve 1 identical , close curve 2, same happens curve 3,4 , 5. there automated on way matlab instead of visual inspection?
thanks
george
might take while if 300 curves in array c(n,300)
. n
arbitrary , number of point have 1 each curve.
for i in 1:300
, j in i:300
want compare c(:,i) - c(:,j)
given threshold (which depends on how want 2 curve differ each other). with: abs(sum(c(:,i) - c(:,j))) < thresh
-> sum difference points between 2 curves, difference should small if curves similar.
when find c(:,j)
below threshold want remove pool of 300 curve. done c = c(:,~ismember(1:size(c,2),j));
give code like:
i = 1; thresh = 1; %arbitrary threshold here adapt needs while i<size(c,2) j = i+1; while j<size(c,2) if abs(sum(c(:,i) - c(:,j))) < thresh c = c(:,~ismember(1:size(c,2),j)); %remove curve j c else j = j+1; end end = i+1; end
edit when comparison threshold want compare absolute value of sum. changed code reflect that.
Comments
Post a Comment