473,385 Members | 1,757 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Connecting to an existing MATLAB COM server from python

Hello,

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

From the MATHWORKS documentation at:

http://www.mathworks.com/access/help.../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.applicatio n') 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
Jul 18 '05 #1
0 1637

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: John Hunter | last post by:
matplotlib is a 2D plotting package for python with a matlab compatible syntax and output tested under linux and windows platforms. matplotlib-0.30 is available for download at...
4
by: dataangel | last post by:
I'm a student who's considering doing a project for a Machine Learning class on pathing (bots learning to run through a maze). The language primarily used by the class has been Matlab. I would...
9
by: Carl | last post by:
I am desperately looking for a way to call Python from Matlab. I have become used to Python's rich syntax and large number of libraries, and feel ridiculously clumsy being stuck with Matlab's...
4
by: itcecsa | last post by:
Hi, I am implementing a small Python project, what I am going to do is to open Matlab and run some M-files, and get some output from Matlab command prompt. I have no idea how to open Matlab...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.