필터 지우기
필터 지우기

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.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrices and Arrays에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by