python list extension with scalars
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Ilya
el 30 de Sept. de 2015
Comentada: Ilya
el 1 de Oct. de 2015
I need to export a few data from MATLAB to Python via the Python engine. It's needed to transform some 1xN vectors to python lists. The problem is that N can be also 1 (or >1). Then the code below won't work.
a_py = py.list(a)
Attempting to first initialize and then extend won't work as well.
a_py = py.list(); a_py.extend(a);
Is there any way to do this in an elegant way without writing if-else conditions?
0 comentarios
Respuesta aceptada
Más respuestas (0)
Ver también
Categorías
Más información sobre Call Python from MATLAB en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!