function [t,C]=matvekst(p,n)
%
%
%
e=ones(n,1);
C = spdiags([(1-p)*e p*e], 0:1, n, n);
C=full(C);
B=eye(n);
t(1)=1;
k=1;
B=C*B;
mxind=10000;
while k<=2*n
  k=k+1;
  tt=norm(B,1);
  if isinf(tt), break,end;
  t(k,1)=tt;
  B=C*B;
end
m=length(t);
semilogy((0:m-1)',t);

