Skip to content

invalid type in for loop expression error when using python objects

a = py.list({1,2,3})

for i=a

disp(i)

endfor

error: invalid type in for loop expression near line 1 column 4

This type of for loop works for normal cell arrays, but gives error for python lists. Cross verified with Matlab. It does not give any error and works normally

Edited by Vishnu Parammal