Azzera filtri
Azzera filtri

How to identify and find same rows in a matrix?

1 visualizzazione (ultimi 30 giorni)
misbah 0332
misbah 0332 il 16 Feb 2016
Commentato: Andrei Bobrov il 16 Feb 2016
Let A be a vector. A = [1 2 3 4; 1 2 3 4; 5 6 7 8; 5 6 7 8; 6 5 4 8; 8 5 2 9] Task 1: Replace same row with single row, means remove repeated row, so updated matrix A will. A(updated) = [1 2 3 4; 5 6 7 8; 6 5 4 8; 8 5 2 9] Task 2: Identify same number of rows in matrix A. A = [1 2 3 4; 1 2 3 4; 5 6 7 8; 5 6 7 8; 6 5 4 8; 8 5 2 9] That is: First two rows are same = 2 Then next two rows are same = 2 Then one row is same = 1 Then one row is same = 1 so it becomes [2, 2, 1, 1] we save this identification in another variable that is same = [ 2, 2, 1, 1] please help me in performing these two tasks.

Risposte (0)

Categorie

Scopri di più su Matrices and Arrays in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by