필터 지우기
필터 지우기

how can we calculate count of specific group in a row

조회 수: 1 (최근 30일)
abdul wahab  aziz
abdul wahab aziz 2016년 8월 22일
댓글: abdul wahab aziz 2016년 8월 22일
i have a matric
3 2 5,
3 2 5,
4 2 5,
4 2 5,
4 2 5,
i need output like this 3 2 5 *2*- where 2 and 3 of times occured
4 2 5 *3*

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2016년 8월 22일
A=[3 2 5,
3 2 5,
4 2 5,
4 2 5,
4 2 5]
[ii,jj,kk]=unique(A,'rows','stable')
out=[ii,accumarray(kk,1)]
  댓글 수: 1
abdul wahab  aziz
abdul wahab aziz 2016년 8월 22일
thanks for answer aziz abdelmalek i need another help now i have grouping is done i want to get most counted col value
e.g 3 2 5-6 3 2 6 -7 so i must be able to access second row 3 2 6 e.g i need its value 2

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by