problem passing x = array([1, 2, 3, 4, 5]) to Matlab
Brought to you by:
ajssf
Hi
I am a Masters student at UTD and have started
learning Python.
I had a really good experience at Pycon 2006.
I am kinda stuck on a small issue of PyMat.
I am tryin to pass a Numeric array to Matlab 7.0.1
I am running Python 2.2 (as PyMat supports that) on
Windows XP.
The problem is that when i pass x = array([1, 2, 3,
4, 5]) to Matlab by using
>>> import pymat
>>> from Numeric import *
>>> x = array([1, 2, 3, 4, 5])
>>> H = pymat.open()
>>> pymat.put(H, 'x', x)
the value of x is [1, 2, 3, 4, 5] in Python, but when
it gets passed to Matlab, it becomes [0 0 0 0 0] ...
all zeros.
Can anyone suggest what needs to be done.
any help would be appreciated.
- Varun
Logged In: NO
Well, perhaps if you define the type as a double first and
then pass it? Matlab default type is double.