Clear Filters
Clear Filters

Converting from fig to jpg for mlreportgen.ppt.Picture

5 views (last 30 days)
I have figures I need to put in a powerpoint. To add a picture to a ppt, I need it to be of class mlreportgen.ppt.Picture. The only way I've found to create an object of this class is to call mlreportgen.ppt.Picture('Path here'); The problem is that this requires it already be saved somewhere. It it too time consuming to take a figure then use saveas() to save as a .jpg, then use mlreportgen.ppt.Picture('Path here') to load it. Why should I save to disk, then load from disk, then delete the file? Surely there is some way to directly create a Picture object from a figure?

Answers (1)

Arka
Arka on 8 Mar 2023
Hi,
As per the documentation for mlreportgen.ppt.Picture, the only input argument it accepts is a picturePath.
To not consume unnecessary disk space, you can try saving an image to the disk, creating the corresponding Picture object, and then programmatically deleting the image.
To learn more about mlreportgen.ppt.Picture and the delete function, please go through the MathWorks documentation links below:

Products


Release

R2020a

Community Treasure Hunt

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

Start Hunting!