Cell array in uitable

3 次查看(过去 30 天)
Lluis Roca
Lluis Roca 2013-10-14
Hi,
I have a cell array output, Value < 10x1 cell>, were each cell in the cell array contains a matrix element < 100x2 double>. Each row inside the matrix element is a set of X and Y coordinates.
How can I store each matrix element separately in a different uitable cell?
Thank.

回答(1 个)

Azzi Abdelmalek
Azzi Abdelmalek 2013-10-14
If a is your cell array
b=cat(2,a{:})
x=b(:,[1 3])
y=b(:,[2 4])
  2 个评论
Lluis Roca
Lluis Roca 2013-10-14
Thank but how do I store them in uitable?
Azzi Abdelmalek
Azzi Abdelmalek 2013-10-14
a={[1 2;3 4;5 6] [1 2;3 4;5 6]*10}
b=cat(2,a{:})
x=b(:,[1 3])
y=b(:,[2 4])
f=figure
headers={'x','y'}
h = uitable(f,'Data',[x(:) y(:)], 'ColumnName',headers);

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Migrate GUIDE Apps 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by