how to pass the matlab data to python to create a csc sparse matrix

9 次查看(过去 30 天)
hello,
I want to pass the matlab data to python to create a csc sparse matrix using python language in matlab. now I met a problem, can you help me? Thank you very much. my code in matlab as follow, I met the data type problem.
iK=[0 2 2 0 1 2];
jK=[0 0 1 2 2 2];
sK=[1 2 3 4 5 6];
data=py.numpy.array(sK);
ir=py.numpy.array(iK);
jr=py.numpy.array(jK);
A = py.scipy.sparse.csc_matrix(data,ir,jr);
when I came to create the csc_matrix, then python would tell me the data type is not right. could you help me correct it? thank you very much.

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Call Python from MATLAB 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by