How to pick out single occurring elements of an array
Show older comments
I'm trying to use a for/while loop to pick out elements of an array that only occur once
For example: i want to pick out elements that occur just once in this array A = [2 4 6 7 3 9 0 3 5 7 3 5 2 4]
i want to put those single occurence elements in another say B = [6 0 9]
Im trying to avoid using 'unique' syntax because it doesnt work in real time simulink environment. So im trying to build it from basics while/for loop
Thanks in advance
3 Comments
Rik
on 19 Nov 2020
I would have to play around for a bit, but I think this should be easy with a later output of unique. Otherwise sorting and calling diff will also work.
Femi Bolarinwa
on 19 Nov 2020
Rik
on 20 Nov 2020
How is it not working? Is there a doc page that describes these limitations? I never heard of such limitations.
Accepted Answer
More Answers (0)
Categories
Find more on Timing and presenting 2D and 3D stimuli in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!