Converting irregular nested python list to matlab array
Show older comments
I am trying to convert an irregular python list ( by irregular I mean size of elements within each sub-list may not be same) to matlab array. The structure of the list is as follows :-
%Python list
nested_list = [
[
[[1,1], [2,2]],
[[3,3], [4,4], [5,5]]]
],
[
[[1,1], [2,2]],
[[3,3], [4,4], [5,5]]],
[[6,6]]
]
]
As you can see the array is 4D and size of each sub list is not constant. I don't wish to use scipy.io.savemat function. I have tried matlab's cell function but coudn't find a way to call it recursively. Is there a way to convert this list to a matlab array/cell array?
Thank You.
Accepted Answer
More Answers (0)
Categories
Find more on Call Python from MATLAB in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!