Importing a list of tuples genrated in python to MATLAB
조회 수: 2 (최근 30일)
이전 댓글 표시
I have a list of tuples generated in python. The list is save in a text file and loaded in MATLAB.
[(2, 4), (2, 12), (2, 8)]
I'd like to import the list in MATLAB as a matrix?
Any suggestion on how this can be done?
댓글 수: 0
답변 (1개)
madhan ravi
2018년 12월 2일
matrix=load('mytext.txt')
댓글 수: 9
madhan ravi
2018년 12월 2일
See the example below:
>> py.list({py.list([1,2]),py.list([3,4])})
ans =
Python list with no properties.
[[1.0, 2.0], [3.0, 4.0]]
>>
참고 항목
카테고리
Help Center 및 File Exchange에서 Call Python from MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!