Publish: how to change the index of the document generated from the code?
1 view (last 30 days)
Show older comments
I would like to generate a report with the Matlab publish tool, but I cannot find a way to generate the table of contents with code.
In my case I have a loop and I would like each iteration to be a point in the index, like it is done with the Sections in the code.
In order to have an index like this:
- Data processing
- Case 1
- Case 2
- ...
Being each case the result of an analysis done on each iteration of a loop:
%%Data processing
for ii = 1:3
%%Case ii
function_that_processes_data_and_plots_results(ii);
end
Is it possible to do it?
Thanks!
0 Comments
Answers (1)
Daniel Armyr
on 3 Feb 2016
I think that what you want to do is not possible. The publish function does not handle dynamic code in the layout. For that you need the MATLAB Report Generator which is a for-purchase add-on.
If you are good enough at programming, you could work around that, though. Rather than having a loop in the script you publish, you could write a pre-processing script that generates the publishable code with all the correct headings. Then you publish that file.
0 Comments
See Also
Categories
Find more on MATLAB Report Generator in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!