-
Notifications
You must be signed in to change notification settings - Fork 23
/
randomPermutedTimes.m
27 lines (21 loc) · 792 Bytes
/
randomPermutedTimes.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
function [ rand_contactSequence ] = randomPermutedTimes(contactSequence)
% randomPermutedTimes returns a randomized dynamic network from the input
% contact sequence by randomly permuting the times of each contact.
%
% Input:
% contactSequence = nEdges x 3 matrix encoding contacts between node
% i,j at time t by (i,j,t).
%
% Output:
% rand_contactSequence = contact sequence of randomized input data.
%
%
%
% Reference: Ann E. Sizemore and Danielle S. Bassett, "Dynamic Graph
% Metrics: Tutorial, Toolbox, and Tale." Submitted. (2017)
%
% Main function:
newOrder = randsample(size(contactSequence,1),size(contactSequence,1));
rand_contactSequence = contactSequence;
rand_contactSequence(:,3) = rand_contactSequence(newOrder,3);
end