 against time for each of the states, you can:
 against time for each of the states, you can:- Compute powers of the transition matrix  
- Extract the diagonal elements  
- Compute the cumulative sum for each state. (Can maintain a row vector corresponding to each state, length = no of steps taken)
 against time for each of the states, you can:
 against time for each of the states, you can:

Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!