====== Differences ====== This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
gibson:teaching:spring-2016:math445:lab6 [2016/02/24 20:44] gibson |
gibson:teaching:spring-2016:math445:lab6 [2018/03/06 06:58] (current) gibson |
||
---|---|---|---|
Line 26: | Line 26: | ||
Compute the Google Page Rank for a network of 100 pages within ''www.unh.edu''. | Compute the Google Page Rank for a network of 100 pages within ''www.unh.edu''. | ||
- | **(a)** Go to the website [[http://www.mathworks.com/moler/chapters.html|Numerical Computing with Matlab]] by Clive Moler and download the “surfer.m” program. Set ''M=100'' and run the command | + | **(a)** Download the [[https://www.mathworks.com/matlabcentral/mlc-downloads/downloads/submissions/37976/versions/7/previews/surfer.m/index.html?access_key=|surfer.m]] Matlab script from [[http://www.mathworks.com/moler/chapters.html|Numerical Computing with Matlab]] by Clive Moler. Set ''M=100'' and run the command ''[w,L] = surfer('http://www.unh.edu',M);''. This might take a few minutes. |
- | ''[w,L] = surfer('http://www.unh.edu',M);''. This might take a few minutes. | + | |
**(b)** After some time this will generate a vector $w$ of websites and a matrix $L$ of links between them. All the entries of $L$ should be either 0 or 1. But $L$ will have 100^2 == 10,000 entries, so you can't check this by eye. Write a short piece of Matlab code that double-checks that all entries of $L$ are either 0 or 1. | **(b)** After some time this will generate a vector $w$ of websites and a matrix $L$ of links between them. All the entries of $L$ should be either 0 or 1. But $L$ will have 100^2 == 10,000 entries, so you can't check this by eye. Write a short piece of Matlab code that double-checks that all entries of $L$ are either 0 or 1. | ||
Line 48: | Line 47: | ||
<code> | <code> | ||
N=40; | N=40; | ||
- | for m=1:N; | + | for n=1:N; |
p=B*p; | p=B*p; | ||
end | end |