
- 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)
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!