필터 지우기
필터 지우기

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

조회 수: 3 (최근 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
Kanchibhotla Chandra Sekhar 2013년 9월 19일
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에서 Loops and Conditional Statements에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by