How to delete repeating value in a row ?

1 Ansicht (letzte 30 Tage)
omran alshalabi
omran alshalabi am 28 Aug. 2022
Kommentiert: omran alshalabi am 28 Aug. 2022
code: from a = [1 2 2 4 4 2 2 1 1 4 4 ]
become b = [1 2 4 2 1 4]

Akzeptierte Antwort

Bruno Luong
Bruno Luong am 28 Aug. 2022
a = [1 2 2 4 4 2 2 1 1 4 4 ]
a = 1×11
1 2 2 4 4 2 2 1 1 4 4
b = a([true diff(a)~=0])
b = 1×6
1 2 4 2 1 4
  1 Kommentar
omran alshalabi
omran alshalabi am 28 Aug. 2022
Thank you very much mr. Bruno Luong for your fast response.
It is function very good.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Graphics finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by