Unable to check checkboxes AppDesigner
2 次查看(过去 30 天)
显示 更早的评论
Hi All,
Currently, I'm working on a table which will hold to numeric columns and eight logical columns (in the appeareance of checkboxes).
I've managed to create this table but unless having specified which columns of a row may be edited this does not work.
After configuring the table I set data to it, initializing each checkbox with the false status, being unchecked.
While running the app the checkboxes can be clicked, the tick appears and while releasing the mousebutton dissapears again.
Any help would be great!
Kind regards,
Colin
set(app.GCL, 'ColumnFormat', {'numeric', 'numeric','logical','logical','logical','logical','logical','logical','logical','logical'});
set(app.GCL, 'ColumnEditable', [false, true, true, true, true, true, true, true, true, true]);
newData = [m+1 0 0 0 0 0 0 0 0 0];
app.GCL.Data = [app.GCL.Data;newData];
0 个评论
回答(2 个)
Dennis
2019-6-20
You need to set the values of your checkbox to true or false, not to 0 or 1. MWE:
t=uitable;
t.ColumnFormat={'logical'};
t.ColumnEditable=true;
t.Data=true;
2 个评论
Jeremy Berke
2024-3-11
I had the same problem and solved it by using a table as the table.Data property.
For example:
lowerBounds = [-20 -20 -20 -20 -20 -20 5 -1 -20 -20]';
upperBounds = [60 60 60 60 60 60 25 1 20 20]';
optimize = logical([1 1 0 1 1 1 1 0 1 1]');
app.paramTable.Data = table(optimize, lowerBounds, upperBounds);
and this solved the issue.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Develop Apps Using App Designer 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!