Last active
August 29, 2015 14:08
-
-
Save robinfang/b2825fe7b1ecbe486fca to your computer and use it in GitHub Desktop.
一些matlab脚本
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| % pagerank | |
| A=[0.0166666666666667,0.466666666666667,0.0166666666666667,0.0166666666666667,0.166666666666667,0.0166666666666667;0.466666666666667,0.0166666666666667,0.916666666666667,0.0166666666666667,0.166666666666667,0.0166666666666667;0.466666666666667,0.466666666666667,0.0166666666666667,0.316666666666667,0.166666666666667,0.0166666666666667;0.0166666666666667,0.0166666666666667,0.0166666666666667,0.0166666666666667,0.166666666666667,0.466666666666667;0.0166666666666667,0.0166666666666667,0.0166666666666667,0.316666666666667,0.166666666666667,0.466666666666667;0.0166666666666667,0.0166666666666667,0.0166666666666667,0.316666666666667,0.166666666666667,0.0166666666666667;] | |
| P0=[0.166666666666667;0.166666666666667;0.166666666666667;0.166666666666667;0.166666666666667;0.166666666666667;] | |
| r(:,1)=P0 | |
| for i = 1:50 | |
| r(:,i+1) = A^i*P0 | |
| end | |
| x = [1:51] | |
| plot(x,r,'DisplayName','r vs.x','XDataSource','x','YDataSource','r');figure(gcf) | |
| % ---- | |
| % plot degree | |
| n=hist(degree,degree(1)); | |
| plot(n);set(gca,'xscale','log');set(gca,'yscale','log'); | |
| xlabel('degree') | |
| ylabel('count') | |
| % ---- | |
| % count vs x | |
| [y,x]=hist(xxx,100000);plot(x,y,'+');set(gca,'xscale','log');set(gca,'yscale','log') | |
| % ---- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment