Skip to content

Instantly share code, notes, and snippets.

@robinfang
Last active August 29, 2015 14:08
Show Gist options
  • Select an option

  • Save robinfang/b2825fe7b1ecbe486fca to your computer and use it in GitHub Desktop.

Select an option

Save robinfang/b2825fe7b1ecbe486fca to your computer and use it in GitHub Desktop.
一些matlab脚本
% 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