Use MatLab to convert from state space to state space (symbolic)

This script requires the MatLab's symbolic toolbox

% Start by clearing everything
clear all
clc

Declare all symbolic variables

syms k1 k2 b m

Define state space system

A=[0 1 0; -k2/m -b/m b/m; 0 1 -k1/b];
B=[0; 0; 1/m];
C=[1 0 0];
D=0;

Define state transformation matrix and find its inverse

T=[1/2 0 1/2; -1 0 1; 0 1 0;];
Tinv=inv(T)
Tinv =

    1.0000   -0.5000         0
         0         0    1.0000
    1.0000    0.5000         0

Find new state space system

% Ahat
Ahat = T*A*Tinv

% Bhat
Bhat = T*B

% Chat
Chat = C*Tinv

% Dhat
Dhat = D
 
Ahat =
[  -k1/(2*b),          -k1/(4*b),    1]
[      -k1/b,          -k1/(2*b),    0]
[ b/m - k2/m, b/(2*m) + k2/(2*m), -b/m]
 
Bhat =
 1/(2*m)
     1/m
       0
 
Chat =
    1.0000   -0.5000         0

Dhat =
     0