3% Computes the stationary solution of a continuous time
8% Q : matrix, shape (M,M)
9% The generator matrix of the Markov chain
13% pi : row vector, shape (1,M)
14% The vector that satisfies `\pi\, Q = 0, \sum_i \pi_i=1`
18% The procedure raises an exception if :code:`checkInput`
19%
is set to :code:`
true` and :func:`CheckGenerator` (Q) fails.
21function pi = CTMCSolve(Q)
23 global BuToolsCheckInput;
24 if isempty(BuToolsCheckInput)
25 BuToolsCheckInput =
true;
28 if BuToolsCheckInput && ~CheckGenerator(Q,
false)
29 error('CTMCSolve: The given matrix
is not a valid generator. If you are sure you want this use CRPSolve instead of CTMCSolve.');