How to copy a Matrix to a table and how to convert a column to a dropdown menu?
1 次查看(过去 30 天)
显示 更早的评论
Q.N 1)
I have a matrix say Z whose size is (4,1). I now want to copy it to a column 4 of my table.
I used the commmads as below but nothing worked.
app.UITable2.data(:,4) = Z ; (It did not work).
app.UITable2.data(:,4) = num2cell(Z ) ; (It did not work).
Q.N 2)
In my table, i want to convert all column 3 cells to a dropdown format which displays Yes and No.
i used the code ,,,,app.UITable.column(3) = categorical({'Yes',{'Yes','No'}); but did not work. Can somebody help me with both the questions.
Thanks.
0 个评论
采纳的回答
Ameer Hamza
2020-6-7
Does your table have more then 4 rows? Try this
app.UITable2.data(1:4,4) = num2cell(Z);
To display a dropdown menu in the column cell, you can do something like this
app.UITable.ColumnEditable(4) = true;
app.UITable.ColumnFormat(4) = {'Yes','No'};
14 个评论
Ameer Hamza
2020-6-13
Can you show the output of
disp(app.UITable.ColumnEditable)
disp(app.UITable.ColumnFormat)
in command window.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Performance and Memory 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!