BENG449 Problem 8 3

BENG449 Problem 8 3 - 4/11/08 1:28 AM MATLAB Command Window...

This preview shows pages 1–2. Sign up to view the full content.

4/11/08 1:28 AM MATLAB Command Window 1 of 2 >> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Alex Lemon % % BENG449 -- Biomedical Data Analysis % % Problem Set 8, Question 3 % % Due April 11, 2008 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Open the data file and extract the data the_data = open('hw8_3.mat'); t = the_data.t; y = the_data.y; % An explanation of how the initial values were obtained is attached b0 = [0.1250 82.8 0.0841]; % Perform the regression by using lsqcurvefit on solve_diffeq maxiter = 10000; options=optimset('display','iter','LargeScale','off','MaxIter',maxiter, . .. 'MaxFunEvals', 500); [b,ss,residual,exitflag,output]=lsqcurvefit(@solve_diffeq,b0,t,y,[],[],options); % Print the coefficients: fprintf('\n%s\n%s%9.6f\n%s%9.6f\n%s%9.6f\n', . .. 'The coefficient estimates are:', . .. 'a = ', b(1), . .. 'b = ', b(2), . .. 'c = ', b(3)); % Generate a curve using the parameter estimates [t1, y1] = ode45(@derivative, t, 0, [], b); % Plot the data and the regression clf; hold on; title('Fitting an ODE model to data');

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 07/19/2008 for the course BENG 449 taught by Professor Richardcarson during the Spring '08 term at Yale.

Page1 / 5

BENG449 Problem 8 3 - 4/11/08 1:28 AM MATLAB Command Window...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online