⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 lprintf_d.m

📁 计量工具箱
💻 M
字号:
% PURPOSE: demo of lprintf() %          LaTeX table printing with symbols% %---------------------------------------------------% USAGE: lprintf_d%---------------------------------------------------% Demo program for LPRINTFclear infobeta = 10*randn(2,3);beta(3,:) = beta(1,:) + beta(2,:);se = beta.*rand(3,3);t = beta./se;pval = abs(rand(3,3))/10;disp('---> LPRINTF Demo  You need to hit a key at each pause.')disp('---> Some sample data:')betapvalpausedisp('---> Bare-bones output: lprintf(beta,se)')lprintf(beta,pval);pausedisp(' ')disp('---> Here we change the symbols.')info.symb = strvcat('^{*}','^{**}','^{***}');lprintf(beta,pval,info);pausedisp(' ')disp('---> Now add some row/column names')info.rname = strvcat('Market A','Market B','Market A+B');info.cname = strvcat('Beer','Wine','Liquor');lprintf(beta,pval,info);pausedisp(' ')disp('---> Now some header/footer stuff')h1 = '\documentclass{article}';h2 = '\usepackage{dcolumn}';h3 = '\newcolumntype{d}{D{.}{.}{-1}}';h4 = '\begin{document}';h5 = '\begin{minipage}{\textwidth}';h6 = '\begin{tabular}{lddd}';t1 = '\end{tabular}';t2 = '\footnotetext{$^{***,**,*}$ indicate significance at the ';t3 = '1\%, 5\%, and 10\% levels, respecively.}';t4 = '\end{minipage}';t5 = '\end{document}';info.head = strvcat(h1,h2,h3,h4,h5,h6);info.tail = strvcat(t1,t2,t3,t4,t5);lprintf(beta,se,info);pausedisp(' ')disp('---> Add some lines. info.lnnum = 2')info.lnnum = 2;lprintf(beta,pval,info);pausedisp(' ')disp('---> Last, save it to a file called test.tex')info = rmfield(info,'cname');newcname =  strvcat('  & \multicolumn{1}{c}{Beer} & ',...'\multicolumn{1}{c}{Wine} & ',...'\multicolumn{1}{c}{Liquor} \\ \hline\hline');info.head = strvcat(info.head,newcname)info.tail = strvcat('\hline\hline',info.tail)lprintf(beta,pval,info,'test.tex');disp(' ')disp('Now LaTeX the file.  Note that it uses the DCOLUMN package.')disp('If you do not have this package remove lines 2 & 3 of the .tex')disp('file and change the ddd in the \begin{tabular} line to rrr')disp('Note that the column headings are also modified for DCOLUMN')disp('by specifying them in the info.head rather than info.cname')

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -