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.
  1 件のコメント
Guillaume
Guillaume 2017 年 6 月 8 日
cell arrays and tables are two completely different things.

サインインしてコメントする。


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 Center および File ExchangeTables についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by