필터 지우기
필터 지우기

Count Relationships between two columns

조회 수: 2 (최근 30일)
Marcelo Costa
Marcelo Costa 2015년 6월 23일
답변: Walter Roberson 2015년 6월 23일
I have this data (Click Here)
I'd like to count how many links a first column number is to a second column number, and so on. For example, how many times the number 1da first column has the number 1 in the second column?

채택된 답변

Walter Roberson
Walter Roberson 2015년 6월 23일
maxdata = max(max(Yourdata(:,1:2)));
counts = accumarray(YourData(:,1:2), 1, [maxdata, maxdata]);
Now counts(J,K) is the number of times the number J appeared in the first column with K in the second column of the same row.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Time Series에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by