Connecting to an existing MATLAB COM server from python

Discussion in 'Python' started by Srinath Avadhanula, Oct 19, 2004.

  1. Hello,

    I wanted to connect to an already existing MATLAB application from
    python.

    From the MATHWORKS documentation at:

    http://www.mathworks.com/access/helpdesk/help/techdoc/matlab_external/ch07cl24.html

    I see that to connect to an already existing MATLAB application, I
    have to do the equivalent of the following Visual Basic code:

    h = GetObject(, "matlab.application")

    Note It is important to use the syntax shown above to connect
    with an existing MATLAB automation server. Omit the first argument,
    and make sure that the second argument reads exactly as shown.

    My question is, how do I replicate this from python? I tried the
    following:

    >>> import win32com.client
    >>> o = win32com.client.GetObject(Class='matlab.application')

    Traceback (most recent call last):
    File "<interactive input>", line 1, in ?
    File "C:\Program_Files\Python23\Lib\site-packages\win32com\client\__init__.py",
    line 71, in GetObject
    return GetActiveObject(Class, clsctx)
    File "C:\Program_Files\Python23\Lib\site-packages\win32com\client\__init__.py",
    line 80, in GetActiveObject
    dispatch = pythoncom.GetActiveObject(resultCLSID)
    com_error: (-2147221021, 'Operation unavailable', None, None)

    I tried searching for relevant things in Google, but couldn't find
    anything close to this. I also read the docstring of
    win32com.client.GetObject, but couldn't figure out the equivalent.

    I already know how to start a new MATLAB COM Server. Something like

    >>> o = win32com.client.Dispatch('matlab.application')


    works fine. But I specifically want to connect to an existing server.

    Srinath
     
    Srinath Avadhanula, Oct 19, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?TWlrZQ==?=

    Connecting VS.NET to existing ASP.NET web

    =?Utf-8?B?TWlrZQ==?=, Dec 3, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    339
    Cowboy \(Gregory A. Beamer\)
    Dec 3, 2003
  2. Jerry Higgins

    Connecting to an existing web

    Jerry Higgins, May 10, 2004, in forum: ASP .Net
    Replies:
    6
    Views:
    573
    Dennis Valencia
    May 11, 2004
  3. Lorenzo
    Replies:
    0
    Views:
    542
    Lorenzo
    Dec 18, 2006
  4. siki
    Replies:
    0
    Views:
    966
  5. Luna Moon
    Replies:
    16
    Views:
    1,347
    Giovanni Gherdovich
    Aug 8, 2008
Loading...

Share This Page