473,569 Members | 2,759 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.Threa d ):

def __init__(self,m atlab_command):
self.matlab_com mand = matlab_command
self.matlab_obj ect = Dispatch('matla b.application.s ingle')
threading.Threa d.__init__(self )

def run(self):
execute = getattr(self.ma tlab_object,'Ex ecute')
execute(self.ma tlab_command)

def awesome_dud(sel f):
execute = getattr(self.ma tlab_object,'Ex ecute')
execute(self.ma tlab_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 952

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

Similar topics

0
1757
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 http://matplotlib.sourceforge.net, and has many new features since the last major release. Multiple outputs matplotlib now supports postscript and GD output, as...
226
12379
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 "help", "copyright", "credits" or "license" for more information. >>> d1 = {'a':1} >>> d2 = {'b':2} >>> d3 = {'c':3}
4
2744
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 prefer to do the bulk of the project in python because I'm familiar with pygame (for the visuals) but I already have a lot of AI code written in Matlab....
19
7148
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 discrete event simulation, but I haven't found any work about continuous system. I would like to develop a generic continous system simulator, and so...
53
4312
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 would welcome comments and corrections, and would be happy to contribute some version of this to the Python website if it is of interest. ===
9
5282
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 rather restricted facilities for doing other things than standard mathematical work. Does anyone know of good techniques (or readily available...
2
5763
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 results as fast as Matlab. any optimization of Numpy code run much faster than Matlab (up to 10 times faster with pyrex).
0
7612
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7924
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8120
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7672
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
1
5512
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5219
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3653
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2113
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 we have to send another system
0
937
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.