How to update Title and Subtitles each time in a loop for publishing document

4 次查看(过去 30 天)
I want to publish the documentation. I am going to do several test on one file and want to publish all of them in one document. I dont want to publish the code into documentation, so i changed the settings. Here my code goes...
%% Title
% Content of the Title
%% Tests To be run
% Detail of the text going to be run
warning off;
for i = 1:10
TC_i = ['TestCase' num2str(i)];
fprintf('%% TestCase %d\n\n',i); // This has to publish Title as each time
%Inputs //1st subheading
x_input = 5*i; %Hz
fprintf('Input A is %d Hz \n',x_input);
y_input = 0.1*i; % pu
fprintf('Input B is %d pu \n\n',y_input);
%Test Results // 2nd subheading
imshow('TC.jpg');
snapnow;
%Result // 3rd subheading
fprintf('Test Result is %s \n\m', 'Pass');
end
So, the problem is Test1,Test2,Test3.....are the titles has to be updated each time as heading (similar to '%%') and Inputs,Test Results & Result has to be updated each time as subheadings (1.1,2.1,3.1..... or just as subheadings)...Actually, images and results are also updated each time as incremented by 'i' value.
// used in above code is to show the requirements only

回答(1 个)

David Sanchez
David Sanchez 2013-9-19
For now, Matlab does not support adding changing titles iterating. You can not change the title on every iteration. Your line
fprintf('%%TestCase %d\n\n',i);
will appear in you publish doc as a comment instead of as a title.
  1 个评论
Kanchibhotla Chandra Sekhar
It is not appearing as the comment but it is appearing just like a line e.g. "TestCase 1" but i want to be as Title which has to reflect in the content also.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Results, Reporting, and Test File Management 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by