Filter löschen
Filter löschen

Count unique vector in a sequence

19 Ansichten (letzte 30 Tage)
Marcus
Marcus am 14 Jul. 2024 um 5:06
Kommentiert: Marcus am 14 Jul. 2024 um 22:08
Hello,
I have a sequence of 16 column vectors v_n with dimension 4x1: [ v_1 v_2 ... v_16 ]
How can I count the number of different vectors in this sequence?
Thanks

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 14 Jul. 2024 um 5:52
Put them together into one 2D array, arranging them as rows (rather than as columns), and then use unique() with the 'rows' option, and count the result.

Weitere Antworten (0)

Kategorien

Mehr zu Creating and Concatenating Matrices finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by