I have a matrix with size of 21600 x 2 as Matrix_Vector = [STD_v,NPV_v]; I'm trying to find the values that matching xvalues = [0:.1:35] from STD_V.
So, I used this code:
[ d, ix ] = min( abs( STD_v-xvalues ) );Matrix_Vector_updated = [STD_v(ix),NPV_v(ix)];
However, I still see values in Matrix_Vector_updated share the same values as 0.468 as below:
0.468490416082415 -68.06235666405440.468490416082415 -68.06235666405440.468490416082415 -68.06235666405440.468490416082415 -68.06235666405440.468490416082415 -68.06235666405440.468490416082415 -68.06235666405440.468490416082415 -68.06235666405440.861091227948802 -62.04603618126100.861091227948802 -62.04603618126100.920662009016715 -52.20251562482630.920662009016715 -52.20251562482631.08087425638995 -34.51979248216801.21018219911556 -45.01470471530471.31409003462488 -62.40487327657171.40064375002948 -49.63185990641401.50221080043184 -60.82663309035231.61795597497108 -48.34424874717061.68219041491832 -37.6318990471176
I'm trying to limit my numbers to the following format where I get only one value from NPV_v (the maximum if there is more than a value) corresponding to each value in STD_V:
00.1000000000000000.2000000000000000.3000000000000000.4000000000000000.5000000000000000.6000000000000000.7000000000000000.8000000000000000.9000000000000001
Can anyone help please
Best Answer