Simple Network Analysis with MatLab Gergana Bounova ESD.342 February 23, 2006 Gergana Bounova ESD.342 Feb 23, 2006MatLab Basics � Official MathWorks tutorial: http://www.mathworks.com/academia/student_center/tutorials/launchpad.html � List of all MatLab functions http://www.mathworks.com/support/functions/alpha_list.html � Search by name, topic, description � MatLab prompt: >> date >> help ‘what’ >> lookfor ‘something’ >> help lookfor LOOKFOR Search all M-files for keyword. See also dir, help, who, what, which. >> diary (filename,on,off) >> load mydata.mat >> type filename.m (.txt) � Loading data: ExcelLink, etc Gergana Bounova ESD.342 Feb 23, 2006Working Example: Bike � References: Daniel Whitney, “Degree Correlations and Motifs in Technological Networks”, Source: http://esd.mit.edu/WPS/esd-wp-2005-10.pdf Gergana Bounova ESD.342 Feb 23, 2006Graph Representation in MatLab � Depends on what you are going to do! Computation, extracting data/properties, visualization… � Adjacency matrix A � node by node (nxn), if i and j are connected A(i,j)=1, otherwise A(i,j)=0; for multiple edges A(i,j)=2,3,… � sum(A) = graph degree sequence (self-loops give an exception) � Incidence matrix C � node by edge (nxm), if node i is an endpoint for edge j, then C(i,j)=1, otherwise C(i,j)=0 � sum(C) = [2 2 2 …2] – every edge has 2 endpoints � Cool formula: A = CxCT -2I � List: every node points to the nodes it’s connected to � Text: for other programs input (Pajek) Gergana Bounova ESD.342 Feb 23, 200601110000000000000000000000001010000000000100100100000000000000000000000000000000000000000000001000000001110000110111111010000110011 10010010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 10010000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 11101111111110100000000010100000000100110000000000000000000000000000000000000000000000000000000000000000001011000000000000000000000 00010100010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 00011000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 01010001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 00010010001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 00110000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 00011000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 00010001000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 00010000001010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 00010000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000100000111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 00010000000001011011000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000101100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000110100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000011000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000100001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000100010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000001000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000001000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 00010000000000000000000001110000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000010110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 00010000000000000000000011000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000011000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 10000000000000000000000000000111010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000001011000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 10000000000000000000000000001100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000001100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000100010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000010000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000011111111110000000000000000000000000000000000000000000000000000000000000 00010000000000000000000000000000000011110000000000111111111100000000000000000000000000000000000000000000000010000000000000000000000 00000000000000000000000000000000000100100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
View Full Document