Borrar filtros
Borrar filtros

How to identify and find same rows in a matrix?

1 visualización (últimos 30 días)
misbah 0332
misbah 0332 el 16 de Feb. de 2016
Comentada: Andrei Bobrov el 16 de Feb. de 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.

Respuestas (0)

Categorías

Más información sobre Matrices and Arrays en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by