一个matlab自动写报告的程序 | 您所在的位置:网站首页 › matlab报告自动生成 › 一个matlab自动写报告的程序 |
最近有很多需要写分析报告的工作,还有很多数据分析图要粘贴在Word文档中,手动复制粘贴图也很麻烦,参考博客园里的code写了一个。原链接和代码如下 https://www.cnblogs.com/airbird/articles/11455243.html filespec_user = [pwd '\测试.doc']; %===启用word调用功能======================================================== try Word = actxGetRunningServer('Word.Application'); catch Word = actxserver('Word.Application'); end Word.Visible = 1; % 使word为可见;或set(Word, 'Visible', 1); %===打开word文件,如果路径下没有则创建一个空白文档打开======================== if exist(filespec_user,'file'); Document = Word.Documents.Open(filespec_user); else Document = Word.Documents.Add; Document.SaveAs2(filespec_user); end %===格式定义=============================================================== Content = Document.Content; Selection = Word.Selection; Paragraphformat = Selection.ParagraphFormat; %===文档的页边距=========================================================== Document.PageSetup.TopMargin = 60; Document.PageSetup.BottomMargin = 45; Document.PageSetup.LeftMargin = 45; Docume |
CopyRight 2018-2019 实验室设备网 版权所有 |