% This m-file computes the state probability vector
% for a Markov Chain with N states and one step transition
% matrix P 
% the vector sspi - contains the answer

bz = zeros(N-1,1);
B = [bz
     1];
I = eye(N);
R = (P-I)';
AU = R(1:N-1, 1:N);
e = ones(1,N);
A = [AU
     e];
sspi = A\B
