Borrar filtros
Borrar filtros

How to compare values in one vector?

2 visualizaciones (últimos 30 días)
huanghui shi
huanghui shi el 9 de Abr. de 2020
Respondida: KSSV el 9 de Abr. de 2020
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?

Respuestas (1)

KSSV
KSSV el 9 de Abr. de 2020
a=[1,2,2,5,4,4];
xbins = unique(a);
[counts,centres] = hist(a,xbins);
iwant = a(counts==1)

Categorías

Más información sobre Modeling en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by