When I execute a MATLAB file that creates multiple plots from MATLAB Notebook, why is only the last plot returned to Word?

2 views (last 30 days)
I execute a MATLAB file that creates multiple plots from the MATLAB Notebook Suite, and only the last plot is returned to Microsoft Word.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 1 Oct 2013
The fact that only the last plot is returned to the MATLAB Notebook document, when creating multiple plots from the Notebook Suite, is a limitation (not a bug) in MATLAB Notebook.
When executing a MATLAB file in the Notebook Suite, all of the data that is normally dumped to the MATLAB command window is dumped to the MATLAB Notebook document. However, when creating multiple plots in a file that is executed in the MATLAB Notebook document, only the last plot is returned to the MATLAB Notebook document. This occurs because plots created in the Notebook Suite are first copied to the Windows Clipboard using the Windows Meta-File Format option and then pasted into the document. When copying and pasting with the Windows Clipboard, you are only allowed to copy and paste one object at a time (a Windows Clipboard limitation). Therefore, only the last figure is available to be pasted from the clipboard.
A workaround would be to define the PLOT in separate scripts and call each on a separate line of the notebook.

More Answers (0)

Categories

Find more on Printing and Saving 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!