MATLAB Answers

Make a Table in UIAxes

4 ビュー (過去 30 日間)
Khalala Mamouri
Khalala Mamouri 2020 年 8 月 28 日
編集済み: Adam Danz 2020 年 8 月 28 日
Hi,
I am looking for a way to plot a Table directly in UIAxes,
This is my code:
fig = app.UIAxes;
dates = datetime([2016,01,17; 2017,01,20],'Format','MM/dd/uuuu');
m = [10; 9];
tdata = table(dates,m,'VariableNames',{'Date','Measurement'});
uitable(fig,'Data',tdata);
Unfortunately it is not working, and not showing error neither !
Thank you

  0 件のコメント

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

採用された回答

Adam Danz
Adam Danz 2020 年 8 月 28 日
編集済み: Adam Danz 2020 年 8 月 28 日
Hm, that should throw an error (but I see that it doesn't).
The uitable should be a child of a "Figure object (default) | Panel object | Tab object | ButtonGroup object | GridLayout object" (parent info). You're setting it as a child of a uiaxes. You probably intended to set it has a child of the figure.
uitable(app.UIFigure,'Data',tdata)
% where app.UIFigure is your figure handle
However, if you're using app designer, the table should typically be created from within app designer and should already exist before you populate it with data. In that case,
app.UITable.Data = tdata
% where app.UITable is a handle to an existing uitable

  0 件のコメント

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

その他の回答 (0 件)

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by