Intro to Matlab

From InterSciWiki
Jump to: navigation, search

Matlab: these *.m programs and data are for students and tutorials, courtesy of Scott D. White See: Matlab code contributed by Scott D. White

Comments

Peter J. Mucha to Doug WikiSysopWikiSysop 05:55, 9 June 2008 (PDT) show details 5:31 AM (21 minutes ago)

Reply

Doug -- Thanks for the update. It's great to see more things available out on the web like this to try to use. I've already sent one of my students off to try some of Scott White's codes.

Peter

Start

set current directory

workspace ; command history; command window

editor

Data

.m programs

Sample programs

file open

"test_example1.m"

load_pajek has some documentation

e.g., parameter ,1) means UseWeights on edges

set breakpoint

continue with
f5


fr_graph fructerman

variables load in workspace

sparse(A) gives you the sparse representation of the matrix


full(A) matrix


DIJK dykstra algorithm shortest path two nodes

put breakpoint at end to be inside and see internal variables

run pagerank on one of the nodes

distribution not sorted eg 1-34

[x_new,indxs]=sort(x) gives original index

BASIC commands

"test_example2.m"

create new pajek files

GRAPH W 4 NODES

; new row
spaces
[ ]


save

breakpoint
f10 step over
visualize
save to pajek

(Octave is freeware but doesn't support all the libraries matlab supports)


"test_example3.m"

Newman's clustering algorithm
applied to Zachary - 3 clusters (bc)
plot_cluster((A,coordinates,bc)

clear

"test_example4.m"