We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
我用您写的模板想使用子函数调用的方式使用,不知道为什么用不起,能指点一下吗?主要您写的这个版本我自己觉得比较看得懂,比较清晰。
import mlreportgen.dom.*; d=Document('demo2','docx'); open(d);
%% 标题 %----------------------------------------------------------------------------------------- p=Heading(1,'Matlab 自动化报告模板');% 一级标题 p.Style={Color('red'),HAlign('center')}; %----------------------------------------------------------------------------------------- append(d,p);
但是如果把上面标题部分内容放到子函数testtest里面就无法实现,如下面的写法
=================================================
% 调用函数 p = testtest(d);
append(d,p);
function out = testtest(d)
p=Heading(1,'Matlab 自动化报告模板');% 一级标题 p.Style={Color('red'),HAlign('center')};
请问一下我怎么才能在子函数里面实现呢,因为如果我想大量的写入文件,想通过调用子函数的方式来实现。不知道是否有空指点一下,谢谢!
The text was updated successfully, but these errors were encountered:
No branches or pull requests
我用您写的模板想使用子函数调用的方式使用,不知道为什么用不起,能指点一下吗?主要您写的这个版本我自己觉得比较看得懂,比较清晰。
在word里面写入文字,操作在一个.m文件中可正常执行
import mlreportgen.dom.*;
d=Document('demo2','docx');
open(d);
%% 标题
%-----------------------------------------------------------------------------------------
p=Heading(1,'Matlab 自动化报告模板');% 一级标题
p.Style={Color('red'),HAlign('center')};
%-----------------------------------------------------------------------------------------
append(d,p);
close(d);
rptview(d.OutputPath);
但是如果把上面标题部分内容放到子函数testtest里面就无法实现,如下面的写法
=================================================
import mlreportgen.dom.*;
d=Document('demo2','docx');
open(d);
% 调用函数
p = testtest(d);
append(d,p);
close(d);
rptview(d.OutputPath);
function out = testtest(d)
p=Heading(1,'Matlab 自动化报告模板');% 一级标题
p.Style={Color('red'),HAlign('center')};
out = p;
请问一下我怎么才能在子函数里面实现呢,因为如果我想大量的写入文件,想通过调用子函数的方式来实现。不知道是否有空指点一下,谢谢!
The text was updated successfully, but these errors were encountered: