How to compare values in one vector?

for example B=[1,2,2,5,4,4]
so i only want output 1,5,i dont want 2,4 because they have same value in this vector.
how to do this within fop-loop?

Antworten (1)

KSSV
KSSV am 9 Apr. 2020

0 Stimmen

a=[1,2,2,5,4,4];
xbins = unique(a);
[counts,centres] = hist(a,xbins);
iwant = a(counts==1)

Kategorien

Mehr zu SimEvents finden Sie in Hilfe-Center und File Exchange

Tags

Gefragt:

am 9 Apr. 2020

Beantwortet:

am 9 Apr. 2020

Community Treasure Hunt

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

Start Hunting!

Translated by