Filter löschen
Filter löschen

Count Relationships between two columns

2 Ansichten (letzte 30 Tage)
Marcelo Costa
Marcelo Costa am 23 Jun. 2015
Beantwortet: Walter Roberson am 23 Jun. 2015
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?

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 23 Jun. 2015
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.

Weitere Antworten (0)

Kategorien

Mehr zu Time Series finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by