insert NxM arrary into a cell in a table

조회 수: 67 (최근 30일)
Guang Zeng
Guang Zeng 2017년 6월 7일
답변: Guillaume 2017년 6월 8일
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
Rik
Rik 2017년 6월 8일
Have a read here and here. It will greatly improve your chances of getting an answer.

댓글을 달려면 로그인하십시오.

답변 (2개)

A. P. B.
A. P. B. 2017년 6월 8일
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 2017년 6월 8일
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);

카테고리

Help CenterFile Exchange에서 Tables에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by