R2013b - uitable can't accept data from new 'table' data type?

5 ビュー (過去 30 日間)
Shad
Shad 2013 年 9 月 11 日
The new 'table' data type in R2013b looks like it has a lot going for it. It seems obvious that we'd be able to directly insert a table variable into a uitable. However, this generates an error and it looks like uitable has not updated (filedate same is the same July 2012 as R2013a). Matlab's variable editor does handle them nicely. Any thoughts on how we can get access to this control for our GUIs?

採用された回答

Peter Perkins
Peter Perkins 2013 年 9 月 12 日
Shad, give this a try:
>> uit = uitable;
>> t = table([1;2;3],[4;5;6])
t =
Var1 Var2
____ ____
1 4
2 5
3 6
>> set(uit,'Data',table2cell(t))
or
>> set(uit,'Data',t{:,:})
The latter is not suitable if the table contains (incompatible) mixed types. Hope this helps.

その他の回答 (1 件)

Shad
Shad 2013 年 9 月 16 日
Thanks Peter, I didn't see the table2cell function. This should work until uitable gets updated.

カテゴリ

Help Center および File ExchangeDevelop Apps Using App Designer についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by