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
0 个评论
回答(1 个)
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.
另请参阅
类别
在 Help Center 和 File 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!