easy way to convert a numpy.ndarray into an Octave array
Is there an easy way to convert a numpy.ndarray into an Octave array?
Very simply:
x = py.numpy.sqrt (1:10);
double(x)
does not work:
error: TypeError: only size-1 arrays can be converted to Python scalars error: called from double at line 108 column 11
In 1D
cell2mat (x{:})
ans =
1.0000 1.4142 1.7321 2.0000 2.2361 2.4495 2.6458 2.8284 3.0000 3.1623
works, but it is probably not very efficient and it can not be extended to more dimensions.