m=5000;%mass of milling machine in kg c=1000;%damping coefficient of milling machine in N-s/m k=10^6;%spring constant of milling machine in N/m t2=0:0.01:10; % time span and fixed time step x0=[0;0]; % initial conditions A=[0 1;-k/m -c/m]; % state matrix A B=[0 0;1 0]; % input matrix B C=[1 0;0 1]; % output matrix C D=[0 0;0 0]; % direct transmission matrix D % input u must have the same number of rows as t and the same number of columns as B [l,m]=size(t2); t2(m)=[]; u=zeros(2,m-1); i=1; y=2/1000*sin(200*pi()*t2); y_prime=2/1000*200*pi()*cos(200*pi()*t2); while(i