% Script e10 Enter a State-Space model
clear % removes all variables from the workspace
A = [-4 1 2; 1 -5 3; 2 0 -6]; % Enter A, B, C, D matrices
B = [1; 0.5; 2]; C = [2 1 2]; D =0;
Gss = ss(A,B,C,D) % create ss model
Gtf = tf(Gss) % convert to transfer function form
pause
Gss_from_tf = ss(Gtf) % convert back to state-space form
Gzpk = zpk(Gss) % convert to ZPK form
eigA = eig(A) % get eigenvalues of system matrix A
% they should be the same as the poles of Gtf
pause
Gss_from_zpk = ss(Gzpk) % convert back to s-s form
pzmap(Gss) % get pzmap from s-s object 

