Sync cell arrays using unique

1 view (last 30 days)
Joel Schelander
Joel Schelander on 20 Apr 2021
Edited: Joel Schelander on 20 Apr 2021
I have two cells GUD and GUDID, GUD is containing a 1x1000 double and GUDID contains a cell for every element in GUD.
I am calculating on GUD here. GUDID contains one ID number for every element in GUD
GUD={[2.56 3.23 1.22....]}
GUDID={173 178 180....}
for lol = 1:numel(GUD)
GUD{lol}=unique(GUD{1,lol});
%GUDID{lol}=...?
end
  1 Comment
Rik
Rik on 20 Apr 2021
It is not clear to me what you question is or what you want to do.
One tiny speedup: as long as you avoid some classes (strings, tables, timetables, and more), you can use the legacy syntax:
idx = ~cellfun('isempty',GUD{lol});

Sign in to comment.

Answers (0)

Tags

Products


Release

R2017b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!