suppose I have the following matrix: a =
2 NaN NaN
4 NaN 3
3 7 9
5 12 5
8 10 8
12 5 10
I need to replace the first x number non-Nan values in each column with Nan.
If number of values to be replaced is x = 3, then the new matrix should be:
b =
NaN NaN NaN
NaN NaN NaN
NaN NaN NaN
5 NaN NaN
8 NaN 8
12 5 10
Any ideas how to do this?
Thanks in advance.