<< pyMain Python Interaction Mechanism in Scilab pyRemove >>

Python Interaction Mechanism in Scilab >> Python Interaction Mechanism in Scilab > pyNpWrap

pyNpWrap

Wrap a Scilab variable in using systematically Numpy.

Calling Sequence

X = pyNpWrap(x [, byCopy])

Arguments

x

Wrappable Scilab data.

byCopy

A boolean.

X

A Python object

Description

The Scilab data are wrapped with a Numpy array (even for matrix 1x1). When byCopy is set to false, the Numpy array will use and a keep a C pointer on the Scilab data, this is why it should be uesd very carefully.

Examples

pyUseScilabIndex(%t);
a = zeros(3, 3);
A = pyNpWrap(a, %f);

// We modify a and look at A
a(2, 2) = 1234;
A

// We modify A (in using the Scilab way to index)
A(3, 3) = 4321;
a

pyRemove numpy A

See Also

History

VersionDescription
5.4.0 Python module.

Report an issue
<< pyMain Python Interaction Mechanism in Scilab pyRemove >>