MATLAB: How to solve a linear equation

equations and systems solverlinear equationMATLABmatrix manipulation

hi, I am solving continuous markov chain state equation. Following is the code of those equations.
how can I get the equations (as example P0 – T(1,:)* [P0; P1 ;P2; P3] = 0) after % equations section?
Thanks
syms P0 P1 P2 P3 % stable state
syms u03 lamda13 lamda20 lamda21 u32
T= [1-u03 0 0 u03;
0 1-lamda13 0 lamda13;
lamda20 lamda21 1-lamda20-lamda21 0;
0 0 u32 1-u32];
% equations
P0=T(1,:)* [P0; P1 ;P2; P3];
P1=T(2,:)* [P0;P1;P2;P3];
P2=T(3,:)* [P0;P1;P2;P3];
P3=T(4,:)* [P0;P1;P2;P3];

Best Answer

Hi,
Here is the solution:
syms P0 P1 P2 P3 % stable state
syms u03 lamda13 lamda20 lamda21 u32
T= [1-u03 0 0 u03;
0 1-lamda13 0 lamda13;
lamda20 lamda21 1-lamda20-lamda21 0;
0 0 u32 1-u32];
% equations
E0=T(1,:)* [P0; P1 ;P2; P3];
E1=T(2,:)* [P0;P1;P2;P3];
E2=T(3,:)* [P0;P1;P2;P3];
E3=T(4,:)* [P0;P1;P2;P3];
% EQNS
EQN0 = P0- E0;
EQN1 = P1- E1;
EQN2 = P2- E2;
EQN3 = P3- E3;
Good luck
Related Question