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

9 views (last 30 days)
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
%Result // 3rd subheading
fprintf('Test Result is %s \n\m', 'Pass');
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

Answers (1)

David Sanchez
David Sanchez on 19 Sep 2013
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 Comment
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.

Sign in to comment.


Community Treasure Hunt

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

Start Hunting!