473,503 Members | 2,163 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Python opening multiple thread of matlab

Hello Python Users,

I've been trying to run multiple thread of Matlab by calling its com
object
via python. However, I keep getting error message that says Python
can't
find the attribute of certain function that I want to execute in
Matlab.

I know the com function is exist, it works just fine if I don't run
within thread.
Below is my sample code, any helps or comments are appreciated.

Thanks,
Tanto

import threading
from win32com.client import Dispatch
class MyThread ( threading.Thread ):

def __init__(self,matlab_command):
self.matlab_command = matlab_command
self.matlab_object = Dispatch('matlab.application.single')
threading.Thread.__init__(self)

def run(self):
execute = getattr(self.matlab_object,'Execute')
execute(self.matlab_command)

def awesome_dud(self):
execute = getattr(self.matlab_object,'Execute')
execute(self.matlab_command)
a = MyThread('a=1:1:100')
b = MyThread('b=1:1:200')

# Running matlab function through thread (It's not working)
# ================================================== =======

a.start()
b.start()
a.join()
b.join()

# Running matlab function not through thread (it's working)
# ================================================== =======
a.awesome_dud()
b.awesome_dud()

Nov 11 '06 #1
0 949

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

Similar topics

0
1751
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...
226
12318
by: Stephen C. Waterbury | last post by:
This seems like it ought to work, according to the description of reduce(), but it doesn't. Is this a bug, or am I missing something? Python 2.3.2 (#1, Oct 20 2003, 01:04:35) on linux2 Type...
4
2740
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...
19
7137
by: Nicolas Pernetty | last post by:
Hello, I'm looking for any work/paper/ressource about continuous system simulation using Python or any similar object oriented languages (or even UML theory !). I'm aware of SimPy for...
53
4291
by: Michael Tobis | last post by:
Someone asked me to write a brief essay regarding the value-add proposition for Python in the Fortran community. Slightly modified to remove a few climatology-related specifics, here it is. I...
9
5280
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...
2
5760
by: lbolla | last post by:
take a look at Python vs Matlab comparison for numerical computations: numerical-computing-matlab-vs-python+numpy+weave it seems that what stated in a previous thread was true! Python+Numpy...
0
7205
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
7287
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7353
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...
0
5596
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4689
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3180
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3170
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1521
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
747
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.