I have two corresponded (has a relation and has the same dimension) dataset:
Time
Salinity
Some data in salinity dataset is NaN.
I can remove the NaN value by:
Salinity_new=Salinity(~isnan(Salinity))
But it will not correspond to the Time
dataset any more.
How can I remove the corresponded time in also?
Thanks
Another solution is the following:
In this way you eliminate the non-numerical value from your vectors.
The comments of Diavakar and patrik are correct. To sum it up and get this question answered, some further remarks.
isfinite
is the same as~isnan
- but with one computation step less, its about 50-90% faster. By introducing amask
you're avoiding the double use ofisfinite
.deal
just saves you some space.