フィルターのクリア

How to identify and find same rows in a matrix?

1 回表示 (過去 30 日間)
misbah 0332
misbah 0332 2016 年 2 月 16 日
コメント済み: Andrei Bobrov 2016 年 2 月 16 日
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.
  1 件のコメント
Andrei Bobrov
Andrei Bobrov 2016 年 2 月 16 日
it's homework. Use unique and histcounts

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrices and Arrays についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by