Publish: how to change the index of the document generated from the code?

1 visualización (últimos 30 días)
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!

Respuestas (1)

Daniel Armyr
Daniel Armyr el 3 de Feb. de 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.

Categorías

Más información sobre Logical en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by