Filter löschen
Filter löschen

Using python in matlab - substitute for []

1 Ansicht (letzte 30 Tage)
Albert Passy
Albert Passy am 26 Jul. 2018
Beantwortet: Matthew Esch am 30 Jul. 2018
So I'm trying to call a python object that is indexed with square brackets []. I can't use the underlying function (__getitem__()). So How do I make this call: worksheet.row_dimensions[1] ? (Python code)

Antworten (1)

Matthew Esch
Matthew Esch am 30 Jul. 2018
I understand you are using Python from MATLAB and are having issue indexing into a Python Object.
Is this object you are trying to index a custom created Python class/container or a builtin Python container such as "list"?
If you are trying to index into a Python built-in structure, please see the following documentation: https://www.mathworks.com/help/matlab/matlab_external/accessing-elements-in-python-container-types.html
If you are trying to index into a Python Object that does not inherit from collections.Sequence or collections.Mapping, this is currently a limitation with MATLAB. More information about unsupported Python indexing can be found at: https://www.mathworks.com/help/matlab/matlab_external/limitations-to-indexing-into-python-objects.html?s_tid=answers_rc2-3_p6_MLT

Kategorien

Mehr zu Call Python from MATLAB finden Sie in Help Center und File Exchange

Tags

Produkte


Version

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by