To add new slides to an existing PowerPoint presentation with the help of mlreportgen.ppt in MATLAB, you can use the following code:
main.m572 chars16 lines
In this code, we first create a Presentation
object by passing the filename of the existing PowerPoint presentation to Presentation
. We then use the getNumberOfSlides
function to get the number of existing slides in the presentation.
We create a for
loop that iterates 5 times (you can change this number to add more or fewer slides) to create new slides using the add
function. The add
function takes the presentation object and the name of the slide layout as inputs. In this case, we're using the 'Title and Content' layout.
We use the replace
function to set the title and content of each new slide. The first argument of replace
is the slide object, and the second argument is the name of the placeholder to replace. The third argument is the text that we want to replace the placeholder with.
Finally, we close the presentation using the close
function.
Note: Make sure to have mlreportgen.ppt
installed and added to the path before running the code.
gistlibby LogSnag