がしきい値に比べて差分値のlogical indexを取得します:
例で
v = [1 2 3 4 5 6 7 8; .5 .56 .57 .7 .9 .87 .6 .4].'; % data
th = .1; % threshold
indKeep = [true; abs(diff(v(:,2)))>=th]; % this assumes the first value is always kept
vPlot = v(indKeep,:); % apply as logical index into the rows of v
、
v =
1.000000000000000 0.500000000000000
2.000000000000000 0.560000000000000
3.000000000000000 0.570000000000000
4.000000000000000 0.700000000000000
5.000000000000000 0.900000000000000
6.000000000000000 0.870000000000000
7.000000000000000 0.600000000000000
8.000000000000000 0.400000000000000
vPlot =
1.000000000000000 0.500000000000000
4.000000000000000 0.700000000000000
5.000000000000000 0.900000000000000
7.000000000000000 0.600000000000000
8.000000000000000 0.400000000000000
すごいです!ありがとうルイス! – Sabre
@Sabre Glad私は助けることができました:-) –