0

I have two corresponded (has a relation and has the same dimension) dataset:

  1. Time
  2. Salinity

Some data in Time dataset are duplicated.

I can remove the duplicate value by:

Time_new=unique(Time,'rows');

But it will not correspond to the Salinity dataset any more.

How can I adjust the corresponded Salinity Data in also?

Thanks

(Adopted from How to avoid the multiple use of 'isnan' to filter inconsitent datasets?)

Community
  • 1
  • 1
Santosa Sandy
  • 217
  • 6
  • 20

1 Answers1

4

Use the additional output arguments of unique:

[Time_new,idx_un,~] = unique(Time,'rows');
Salinity_new = Salinity(idx_un, :);
Bentoy13
  • 4,886
  • 1
  • 20
  • 33