function tex_fig = tex_fig_print(fid,Prob_Num,Roman,Letter,Plot_Number,Print_Str,u_str,gamma,sigma2,theta_hat_0) % Gregory J. Toussaint % ECE 417 Nonlinear and Adaptive Control % 21 Sep 98 % Filename: tex_fig_print.m % % This function writes a block of text to the file designated by fid % to generate the LaTeX commands to print the figure. I assume the file % is open with permission to append to the file and all of the above % arguments are passed as string variables except for fid. % % The output will look something like the following, but not exactly: % %\begin{figure}[hbtp] %\centering % \begin{tabular}{c} % \epsfig{figure=Print_Str,width=2.9 in} % \end{tabular} % \caption{Problem Prob_Num(Roman-Plot_Number).} %\label{fig:probProb_Num:Letter:Plot_Number} %\end{figure} % % Check the .tex file with a small sample to get the format correct % before you run many cases. Make adjustments to the following % as necessary. % fprintf(fid,'\\begin{figure}[hbtp] \n'); fprintf(fid,'\\centering \n'); fprintf(fid,' \\begin{tabular}{c} \n'); fprintf(fid,[' \\epsfig{figure=',Print_Str,',width=2.9 in} \n']); fprintf(fid,' \\end{tabular} \n'); fprintf(fid,[' \\caption{\n']); fprintf(fid,[' Problem ',Prob_Num,'(',Roman,'-',Plot_Number,').\n']); %fprintf(fid,[' Parameter settings: $\\gamma = $',num2str(gamma),', \n']); fprintf(fid,[' Parameter settings: $\\gamma = $ %6.1e, \n'],gamma); fprintf(fid,[' $\\sigma^2 = $',num2str(sigma2),', \n']); fprintf(fid,[' $u(t)=$',u_str,', \n']); fprintf(fid,[' $\\hat{\\theta}(0) = $[\n']); for k = 1:length(theta_hat_0) if k == length(theta_hat_0) fprintf(fid,[num2str(theta_hat_0(k)),']$^T$. \n']); else fprintf(fid,[num2str(theta_hat_0(k)),' \n']); end; end; fprintf(fid,['} \n']); fprintf(fid,['\\label{fig:prob',Prob_Num,':',Letter,':',Plot_Number,'} \n']); fprintf(fid,'\\end{figure} \n'); fprintf(fid,'\n'); fprintf(fid,'\n'); fprintf(fid,'\n'); fprintf(fid,'\n'); % End of tex_fig_print.m % Gregory J. Toussaint