checkbox in APP designer

65 ビュー (過去 30 日間)
José Barrera Alvarez
José Barrera Alvarez 2020 年 6 月 10 日
In the Matlab built in examaple call "TableDataAppExample.mlapp", a graphical table component is filled (by the function startupFcn(app)) with a variable table call "t" by the sentence
% Add data to the Table UI Component
app.UITable.Data = t;
The data in the therd column of the variable table "t" is a logical value, its value either is "true" or "false", and after filling the graphical table (by app.UITable.Data = t;) it happens that in the therd column logical "true" appears as a checked checkbox, and logical "false" appears as an unchecked checkbox.
My problem is...
When I do the same in my ongoing APP design it happens that when a fill my graphical table from a variable table, columns defined in this variable table as logical "true" appear as a "1" in the graphical table, and columns defined as logical "false" appear as a "0",
How can I make them to appear as a checked or unchecked checkbox as in the "TableDataAppExample.mlapp" example ?.

採用された回答

Monika Phadnis
Monika Phadnis 2020 年 10 月 9 日
R2020b Documentation for 'uitable' specifies that logical arrays will be displayed as checkboxes.
Refer this page:
Is there any error or warning displayed for your use case?
  1 件のコメント
José Barrera Alvarez
José Barrera Alvarez 2020 年 10 月 12 日
After reading your indicated help page, I understood that I was not using the “ColumnFormat” property to define the format of the cell array columns when creating my table. After correct use of that property now is o.k..
The problem came from the fact that the in the indicated built in app example, there is no stamement using the “ColumnFormat” property. The indicated “t” the table is obtained by reading an excel file by
t = readtable('patients.xls');
(so I assume that the format of the “t” table columns (char, numeric, logical ,....) is inherited someway from this excel file).
Thank you very much for your answer !.

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

その他の回答 (0 件)

カテゴリ

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

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by