% Example ID2.2 Estimating parameters of a first order model % % Copyright 1996, Babu Joseph, Washington University in St. Louis % clc;echo on; % This program computes the parameters using a linear least squares approach % % the data give is as follows % ( It is step response of a first order process with gain 1 and tau=5) % % Input Output % 1 0 % 1 .18 % 1 .33 % 1 .45 % 1 .55 % 1 .67 % % First set up the matrices A=[ 0 1 -.181 1 -.33 1 -.45 1 -.67 1]; % b=[ .18 .33 .45 .55 .67]; % % The model is given by x=A\b; % The model coefficients are a1=x(1) b1=x(2) % The error is the model is given by Sum_of_Squares=norm(b-A*x)^2