Closed dlaidig closed 8 years ago
What data were you trying to send?
A two-dimensional numpy array.
This fails on my system (Matlab R2015b, python3-msgpack 0.4.8, current transplant from master):
import numpy as np
from transplant import Matlab
m = Matlab()
print(m.sqrt(np.ones((1, 256))))
With (1, 255) it still works as both shape entires are uint8.
Should be fixed in 993a81392454bd65e57c6449d38032fc78116c4d. Can you confirm this?
Yes, works for me. :) I noticed in the code that the same is done for sparse matrices (which I don't use). Shouldn't the same be done there?
Great find! Thank you! I'll fix it right away.
OK, should be fixed now.
When using transplant, I got an error "All contents of the input cell array must be of the same data type. (MATLAB:cell2mat:MixedDataTypes)". It turns out that this happens in the function decode_matrix() of transplant_remote.m when trying to convert the shape to a matrix. The different entries of the shape are stored as the smallest fitting integer type which causes cell2mat to fail.
In decode_matrix():
As a quick fix, I changed the python side to transmit the shape as floats, but I don't know transplant and msgpack good enough to suggest an elegant solution.