Is it possible to use (publish) markup inside nested functions

2 ビュー (過去 30 日間)
John Anderson
John Anderson 2016 年 8 月 16 日
回答済み: Sean de Wolski 2016 年 8 月 16 日
Hi all,
I have the following function
function test1
%%Individual sample reports
reportSample;
%%overall summary
reportSummary
function reportSample
for i = 1 : 5
disp( [ '<html><h3>sample ' num2str( i ) '</h3><hr></html>' ] );
end
end
function reportSummary
disp( [ '<html><h3>summary</h3><hr></html>' ] );
end
end
When I attempt to publish this function this yields the following report
The problem is that the heading 'overall summary'appears directly after the heading 'Individual summary reports' even though the html referencing the individual summaries has not been published. Is it possible to force the publishing of the contents of the nested functions so that the correct ordering is achieved, i.e. the individual report summaries come before the overall summary?
Best wishes,
John
  1 件のコメント
John Anderson
John Anderson 2016 年 8 月 16 日
silly me, I should not have included the markup heading inside the nested function. Remove these and the publish command works fine.
function test1
%%Individual sample reports
reportSample;
%%overall summary
reportSummary
function reportSample
for i = 1 : 5
disp( [ '<html><h3>sample ' num2str( i ) '</h3><hr></html>' ] );
end
end
function reportSummary
disp( [ '<html><h3>summary</h3><hr></html>' ] );
end
end
%

サインインしてコメントする。

採用された回答

Sean de Wolski
Sean de Wolski 2016 年 8 月 16 日
Also note that if you're trying to do fancy markup, you may be better off with the report generator that gives you really fine control over everything. It's kind of the whole point of the product.

その他の回答 (0 件)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by