I have the following data (matrix).
I need to delete it if there is only 1 datapoint, 2 or more should stay. so in this example, -12.5 should be deleted.
If num - 1 index = NaN and num + 1 = NaN Delete that row end
NaN NaN -12,5000000000000 NaN NaN -8,90000000000000 -9,20000000000000 NaN NaN -9,60000000000000 -9,60000000000000 -9,60000000000000 NaN
No products are associated with this question.
value = [NaN, NaN, -12.5, NaN, NaN, -8.9, -9.2, NaN, ... NaN, -9.6, -9.6, -9.6, NaN]; index = strfind(isnan(value), [true, false, true]); value(index + 1) = ;
[EDITED] Perhaps you need a transpose(value), because strfind requires a row vector.
Play games and win prizes!Learn more