Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to comunicate between Matlab And power point or Matlab and acrobat reader

I want to send a variable from Matlab to PowerPoint or AcrobatReader, then depend on the value of this variable, PowerPoint goes to next or previous slide or exit, or zoom in or zoom out in acrobatreader. is it possible? it should be because nowadays we can control these kind of software with remote control it means they can get data from outside, but how is or what is the protocol? tanx.

like image 551
Alex Avatar asked Jun 15 '11 14:06

Alex


People also ask

How do I open a Powerpoint file in Matlab?

Open a Presentation Create a presentation. ppt = Presentation('myPresentation. pptx'); Open the presentation.


2 Answers

You can drive PowerPoint via ActiveX

h = actxserver('PowerPoint.Application');
h.Visible = 1; % make the window show up
h.Presentations.Open('C:\Temp\MyPresentation.pptx');
%%
h.ActivePresentation.SlideShowSettings.Run;  % there is now a slide show running
%%
hShow = h.SlideShowWindows.Item(1);
%%
hShow.View.GotoSlide(3);  % go to the 3rd slide
hShow.View.Next;   % go to next slide
%%
hShow.View.Exit;   % end slide show
%%
h.ActivePresentation.Close;   % close the presentation
%%
h.Quit;
delete(h);

You should check out the MATLAB documentation for actxserver, and also the MSDN Power Point developer Reference. Most of the methods and properties of an ActiveX object show up in MATLAB as methods and properties. You can use methods(h) and get(h) to examine them. The only tricky ones are collections. You will generally need to say something like hCollection.Item(N) to get the N-th item from the collection.

like image 132
Lambdageek Avatar answered Sep 29 '22 06:09

Lambdageek


My understanding is that remote control presenters work by simulating keystrokes (such as right arrow for next slide, etc.) To do something similar in MATLAB, you could explore java.awt.Robot in the same way as this post from MathWorks.

like image 27
Tom Avatar answered Sep 29 '22 07:09

Tom