How to create multiple slides in Presentation Generator?

5 ビュー (過去 30 日間)
Anna Wachnowicz
Anna Wachnowicz 2020 年 10 月 23 日
コメント済み: Anna Wachnowicz 2020 年 10 月 29 日
Hello, I am fairly new to Matlab and I still struggle with loops and indexing.
I would like to add to my Power Point presentation a number of slides that correspond to the number of files in a folder.
Using dir() i get the number of files and I would like to create somtehing like:
import mlreportgen.ppt.*;
slidesFile = 'mySlides.pptx';
slides = Presentation(slidesFile);
files = dir(my_folder);
s = length(files)
for
i = 1:length(files)
slide{i} = add(slides,'Title and Content');
replace(slide{i},'Content', i_stfile.png});
end
close(slides);
I am trying to figure out the correct indexing syntax.
I would be very grateful for any help

採用された回答

Prabhanjan Mentla
Prabhanjan Mentla 2020 年 10 月 27 日
Hi,
dir command helps in fetching files and folders in the current folder, one can even specify the type they need.
import mlreportgen.ppt.*
ppt = Presentation('myPresentation.pptx');
open(ppt);
files = dir('myNewFolder');
for i=1:length(files)
add(ppt,'Blank');
end
close(ppt);
Above is the sample code but do refer to this similar question answered by me.
Hope this helps.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCreate and Format Presentation Objects についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by