Effacer les filtres
Effacer les filtres

How to identify and find same rows in a matrix?

1 vue (au cours des 30 derniers jours)
misbah 0332
misbah 0332 le 16 Fév 2016
Commenté : Andrei Bobrov le 16 Fév 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.

Réponses (0)

Catégories

En savoir plus sur Matrices and Arrays dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by