Python in Matlab: accessing list of lists

2 visualizaciones (últimos 30 días)
Evan
Evan el 13 de Nov. de 2015
Comentada: Evan el 13 de Nov. de 2015
I have some code that generates a Python list of Python lists. Unfortunately I don't seem to be able to access the contents. I get the following error:
>> eventList{1}
Cell contents reference from a non-cell array object.
Is this just a current limitation of Python support? I checked this page , and I don't see it listed.

Respuesta aceptada

Robert Snoeberger
Robert Snoeberger el 13 de Nov. de 2015
Editada: Robert Snoeberger el 13 de Nov. de 2015
"Python Objects: Indexing Support" is listed in the R2015a release notes [1]. Which version of MATLAB are you using?
In the absence of indexing, you can use operator.getitem [2].
Example:
>> py.operator.getitem(eventList, int32(0))
  1 comentario
Evan
Evan el 13 de Nov. de 2015
Oddly, the curly bracket indexing started working after restarting Matlab. But this also works.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Call Python from MATLAB en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by