フィルターのクリア

Setting data at a uitable

13 ビュー (過去 30 日間)
Giovanni Gardan
Giovanni Gardan 2020 年 10 月 13 日
回答済み: Walter Roberson 2020 年 10 月 13 日
Hi,
I want to visualize the output of a code in tabular form, using "uitable".
The specific outputs are taken from the workspace that I insert in the Attachment I put below this question.
  • I define h as the 1X4 cell array which rapresent the name of the columns of the table I want to create.
  • I define NODI_MAT_DIG as the 19x2 string array which rapresent the data of the first two columns.
  • I define aa and bb which are respectively the 3th and 4th column.
I don't undestrand why Matlab makes the following error:
Error using uitable
Functionality not supported with figures created with the figure function. For more information, see Graphics Support in App Designer.
Error in uitable (line 53)
thandle = builtin('uitable', varargin{:});
Error in PF_UNIPD_NS_PVcontrol (line 147)
t=uitable(f,'data',data,'columnname',h)
h = {'Nodo_Matlab' 'Nodo_PowerFactory' 'Modulo_Matlab' 'Fase_Matlab'}
NODI_MAT_DIG = [(1:N_nodi_tot)' nodi_originali]; %19x2 string
aa = abs(En);
bb = (angle(En))*180/pi;
data = [NODI_MAT_DIG, aa, bb];
f = figure;
t = uitable(f,'data',data,'columnname',h)

採用された回答

Walter Roberson
Walter Roberson 2020 年 10 月 13 日
Pretty much like it says. When you use a traditional figure, you are not permitted to set the uitable data property to a string() array.
Set it to a cellstr instead:
t = uitable(f, 'data', cellstr(data),'columnname',h)

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMigrate GUIDE Apps についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by