insert NxM arrary into a cell in a table

72 visualizaciones (últimos 30 días)
Guang Zeng
Guang Zeng el 7 de Jun. de 2017
Respondida: Guillaume el 8 de Jun. de 2017
I need to create a table, my table is Nx2 for example
image vehicle position
-----------------------------
frame1 [1 1 100 100; 33 44 100 100]
frame2 [100 100 23 44]
How to write code to do this? Thanks
  1 comentario
Rik
Rik el 8 de Jun. de 2017
Have a read here and here. It will greatly improve your chances of getting an answer.

Iniciar sesión para comentar.

Respuestas (2)

A. P. B.
A. P. B. el 8 de Jun. de 2017
To insert an array into a table you can
(1) create the cell; cell=zeros(N,2)
(2)convert the matrix to a cell before inserting using cell2mat; cell(1,1)=mat2cell(MATRIX,N,M); where N and M are the size of the matrix.

Guillaume
Guillaume el 8 de Jun. de 2017
There are many ways of creating tables. One possible way:
image = {'frame1', 'frame2'};
vehicle_position = {[1 1 100 100; 33 44 100 100]; [100 100 23 44]};
t = table(images, vehicle_position);

Categorías

Más información sobre Tables en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by