473,545 Members | 2,639 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

pythoncode in matlab

Hello guys,
is there any possibiliy using Phython code in Matlab. I couldnt find
any helpful stuff. Its not graphical stuff I am doing just
calculations with arrays and strings.

Thanks for answering in advance

Sven
May 11 '06 #1
4 2016
check out PyMat:
http://claymore.engineer.gvsu.edu/~s...hon/pymat.html

I've never used it but I believe it should work for your needs.
However, I highly recommend taking a look at SAGE:
http://modular.math.washington.edu/sage/
which has an interface to octave.

-ph

May 11 '06 #2
pa************@ gmail.com wrote:
check out PyMat:
http://claymore.engineer.gvsu.edu/~s...hon/pymat.html

I've never used it but I believe it should work for your needs.
However, I highly recommend taking a look at SAGE:
http://modular.math.washington.edu/sage/
which has an interface to octave.

-ph

PyMat will not help you! PyMat works the other way around, ie it allows for
Matlab calls from Python.

Basically you need to build a Python extension which includes calls to the
matlab engine (see the Python and Matlab manuals). Another way is to make a
shell call Python directly via "!python -c 'myscript.py'" and possibly save
the results on a file, for further processing by Matlab.

If you know about Scilab (which is a free and very capable Matlab clone,
www.scilab.org) you can take a look at its Matlab-equivalent perl command
(ie a Matlab script that calls perl). You can use this perl command for
building a python command in Matlab.

Carl
May 11 '06 #3
> PyMat will not help you! PyMat works the other way around, ie it
allows for Matlab calls from Python.


excuse my ignorance: but why would that not be helpful? I may be
missing something blindingly stupid (very possible) but it seems to me
using PyMat would be just as powerful (if not more) as building
extensions...

-ph

May 11 '06 #4
Hi Sven,

I don't have Matlab on my computer so the following is just a wild guess:

As far as I know you can include C code into Matlab or at least into
Simulink. Maybe you could try to execute your Python script in that C code?

Daniel

May 12 '06 #5

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

Similar topics

2
16878
by: Mathias | last post by:
Dear NG, I currently ty to switch from matlab to python/scipy but have a lot of trouble with images. What I need is a function for subsequently displaying a number of 2D-matrices as an image. I tried: - Image.show() which is nice but slow and I don't seem to be able to either close the window nor draw again to the same window, so I end up...
4
2743
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....
3
3992
by: Mohammed Smadi | last post by:
Hi; Does anyone know if we can call matlab for a python or bash script while feeding the matlab script some command line arguments? I have an interactive matlab script which i want to automate by feeding the args from a script. I know this is probably more suitable to a matlab group but any ideas will be appreciated.
6
22235
by: Lars Christiansen | last post by:
Hi! I am a master student in (geo)physics at the University of Copenhagen and part of a study group on C++ as a scientific programming language. I, and the other students in the group, have previously used MatLab in different courses to solve problems, and find it very easy to use. This has led us to the discussion: When should we use...
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 rather restricted facilities for doing other things than standard mathematical work. Does anyone know of good techniques (or readily available...
8
2111
by: Allen | last post by:
Does anyone agree with me? If you have used Matlab, welcome to discuss it.
3
27227
by: Ajith Menon | last post by:
Do any body know how to use the functions available in the MATLAB using C#? ( To be specific, functions COHERE used to find Coherence and TFE to calculate Transfer function are needed. These functions are available in the MATLAB SP toolbox) These functions require input waveforms X and Y, which is nothing but two array of samples...
4
13722
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 from Python! Any suggestions would be appriciated!
14
3120
by: Luna Moon | last post by:
Dear all, Can C++/STL/Boost do the vectorized calculation as those in Matlab? For example, in the following code, what I really want to do is to send in a vector of u's. All other parameters such as t, l1, l2, l3, etc. are scalars... But u is a vector.
0
7490
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7780
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6009
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5351
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
5069
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
3465
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1911
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
1
1037
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
734
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.