필터 지우기
필터 지우기

Python in Matlab: accessing list of lists

조회 수: 4 (최근 30일)
Evan
Evan 2015년 11월 13일
댓글: Evan 2015년 11월 13일
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.

채택된 답변

Robert Snoeberger
Robert Snoeberger 2015년 11월 13일
편집: Robert Snoeberger 2015년 11월 13일
"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
Evan
Evan 2015년 11월 13일
Oddly, the curly bracket indexing started working after restarting Matlab. But this also works.

댓글을 달려면 로그인하십시오.

추가 답변 (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