function prob16_prt = prob16_print(t,theta_hat,theta_naught,title_str) % Gregory J. Toussaint % ECE 417 Nonlinear and Adaptive Control % 26 Oct 98 % Homework Assignment 4 % Problem 16 % Filename: prob16_print.m % % This function displays the results of the simulation % Plot the convergence of the parameters for k = 1:size(theta_hat,1) subplot(3,2,k) % Plot the log of the magnitude of the error semilogy(t,abs(theta_hat(k,:)-theta_naught(k))) if k==1 | k==2 title(title_str); end; ylabel(['Error for \theta(',num2str(k),')']) if k==2 | k==5 xlabel('Time Steps'); end; grid on A = axis; Y_lim = ylim; axis([0 t(length(t)) Y_lim]); hold off end; % for k loop % End of HW 4 Problem 16 % Gregory J. Toussaint