フィルターのクリア

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 Center および File ExchangeTime Series についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by