Hi, I have a problem that I can not solve.
I need to extract a portion of my vector, this vector has 2 columns (first column is time and second is wave height) and 2500 rows, the values of the second column are number and NaN, the data are sampled every 3 hours. The problem is: I need to create a new vector that contains only the registration longer than 20 hours, and for the rest I must to replace with NaN.
Here an example:
Initial vector= [0 0.2 3 0.35 6 NaN 9 NaN 12 NaN 15 NaN 18 NaN 21 NaN 24 0.29 27 0 30 0 33 0 36 0 39 0 42 0 45 0.18 48 0.33 51 NaN 54 NaN 57 NaN]The result should be [0 NaN3 NaN6 NaN9 NaN12 NaN15 NaN18 NaN21 NaN24 0.2927 030 033 036 039 042 045 0.1848 0.3351 NaN54 NaN57 NaN]
Can anyone suggest an approach to solve this problem?
Thanking you in advance
Alessandro Antonini
Best Answer