Rank: 549 based on 207 downloads (last 30 days) and 5 files submitted
photo

Mark Brown

E-mail

Personal Profile:

Professional Interests:

 

Watch this Author's files

 

Files Posted by Mark View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
01 Nov 2005 saveppt This function saves Matlab figure windows or Simulink models to a Powerpoint file. Author: Mark Brown activex, powerpoint, plot, tools, export, graphics 143 40
  • 4.56757
4.6 | 38 ratings
14 Oct 2005 Screenshot GPRINTF General replacement for fprintf which allows printing formatted text to separate editable window. Author: Mark Brown simulink, development environme..., fprintf, text, display 8 4
  • 5.0
5.0 | 4 ratings
05 Oct 2005 Screenshot jprintf JPRINTF allows printing formatted text to separate windows using MATLAB, Simulink, or Stateflow. Author: Mark Brown formatted text, development environme..., fprintf, simulink, edit window, gprintf 11 4
  • 4.75
4.8 | 4 ratings
08 Jul 2003 Screenshot PAN Allows horizontal and vertical panning via pushbuttons. Author: Mark Brown data, zoom, graphics, plot, pan, data exploration 21 1
  • 5.0
5.0 | 1 rating
07 Jul 2003 DRAGPLOT DRAGPLOT allows plots to be moved between figure windows via drag 'n drop. Author: Mark Brown plot, figure, drop, drag, mouse, window 24 8
  • 4.5
4.5 | 6 ratings
Comments and Ratings on Mark's Files View all
Updated File Comment by Comments Rating
20 Nov 2009 saveppt This function saves Matlab figure windows or Simulink models to a Powerpoint file. Author: Mark Brown Roth, Jeffrey

Do the authors or others know if there is an equivalent routine that will run on Matlab in linux and export the figures to a non-MS PowerPoint equivalent (eg, OpenOffice or StarOffice).
Thanks! Jeff

30 Oct 2009 DRAGPLOT DRAGPLOT allows plots to be moved between figure windows via drag 'n drop. Author: Mark Brown Mmd

Very useful program, thanks.

12 Aug 2009 saveppt This function saves Matlab figure windows or Simulink models to a Powerpoint file. Author: Mark Brown Mel

I don't know if it is a bug (can't find it in the database) but it seems that when copying through the clipboard using the .emf option, dashed lines in the figures get converted into normal. This is irritating!

Everything works fine however if you do it by saving first the figure into an .emf file and then use Insert Picture->From File in PowerPoint to import the figure.

This can be done automatically by modyfing saveppt.m to save the figure into a temporary emf-file instead of the Clipboard.
1.Change the lines
   % Capture current figure/model into clipboard:
    print('-dmeta', prnopt);
to
 % Save current figure/model into a temporary emf-file
    emffile = fullfile(fpath, 'resfig.emf');
    print('-dmeta', prnopt, emffile);
2. Change
   % Paste the contents of the Clipboard:
    pic1 = invoke(new_slide.Shapes,'Paste');
to
 % Insert the contents of the emf-file
    pic1 = invoke(new_slide.Shapes,'AddPicture',emffile,true,true,0,0,...
                  slide_W,slide_H);
    % Delete the temporary file
    delete(emffile);

12 Aug 2009 saveppt This function saves Matlab figure windows or Simulink models to a Powerpoint file. Author: Mark Brown Mel

A correction:). Adding ppt.delete does not solve the problem of the activeX server running ahead on itself as I claimed in my last comment:).

There is though a simple solution which also makes export of many figures much faster. Just give an array of figure handles as an additional argument to the function and move the loop over the figures into the application. Something like

function savepptmany(filespec, figvec, titletext, prnopt)
[...]
% Start an ActiveX session with PowerPoint:
ppt = actxserver('PowerPoint.Application');

if ~exist(filespec,'file');
  % Create new presentation:
  op = invoke(ppt.Presentations,'Add');
else
  % Open existing presentation:
  op = invoke(ppt.Presentations,'Open',filespec,[],[],0);
end

% Loop over figures
for addfig = 1:length(figvec)
  figure(figvec(addfig));

  % Capture current figure/model into clipboard:
  if nargin<3
    print -dmeta
  else
    print('-dmeta',prnopt)
  end

 % Get current number of slides:
 slide_count = get(op.Slides,'Count');
  
 % Add a new slide (with title object):
  slide_count = int32(double(slide_count)+1);
  new_slide = invoke(op.Slides,'Add',slide_count,11);

  [...]
  % Center picture on page (below title area):
  set(pic1,'Left',single((double(slide_W) - double(pic_W))/2));
  set(pic1,'Top',single(double(slide_H) - double(pic_H)));
end

if ~exist(filespec,'file')
  % Save file as new:
  invoke(op,'SaveAs',filespec,1);
else
  % Save existing file:
  invoke(op,'Save');
end
  [...]
Note that titletxt has to be cell array of strings now.

29 May 2009 saveppt This function saves Matlab figure windows or Simulink models to a Powerpoint file. Author: Mark Brown Mel

I am not en expert in ActiveX but adding
ppt.delete;
in the end of saveppt.m seems to solve the problem of running ahead of itself when saving many images. Excellent application!

Top Tags Applied by Mark
data exploration, development environment, fprintf, graphics, plot
Files Tagged by Mark View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
01 Nov 2005 saveppt This function saves Matlab figure windows or Simulink models to a Powerpoint file. Author: Mark Brown activex, powerpoint, plot, tools, export, graphics 143 40
  • 4.56757
4.6 | 38 ratings
14 Oct 2005 Screenshot GPRINTF General replacement for fprintf which allows printing formatted text to separate editable window. Author: Mark Brown simulink, development environme..., fprintf, text, display 8 4
  • 5.0
5.0 | 4 ratings
05 Oct 2005 Screenshot jprintf JPRINTF allows printing formatted text to separate windows using MATLAB, Simulink, or Stateflow. Author: Mark Brown formatted text, development environme..., fprintf, simulink, edit window, gprintf 11 4
  • 4.75
4.8 | 4 ratings
08 Jul 2003 Screenshot PAN Allows horizontal and vertical panning via pushbuttons. Author: Mark Brown data, zoom, graphics, plot, pan, data exploration 21 1
  • 5.0
5.0 | 1 rating
07 Jul 2003 DRAGPLOT DRAGPLOT allows plots to be moved between figure windows via drag 'n drop. Author: Mark Brown plot, figure, drop, drag, mouse, window 24 8
  • 4.5
4.5 | 6 ratings
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com