how to make all cells in uitable editable in matlab GUI and save them when i press pushbutton ? how to read all contents from xlsread array
7 次查看(过去 30 天)
显示 更早的评论
I have GUI which has uitable. I want to read data into table and display when I select options in the listbox ... The GUI also has two push buttons edit and save to enable edit and save after I make changes I am using xlsread to read data into array. however, for some reason, it reads all the cells but not the first two rows of excel file which has text
0 个评论
采纳的回答
Walter Roberson
2018-6-23
[~, ~, raw] = xlsread('YourFile.xls');
Now raw will contain headers and all.
h = uitable('data', raw, 'ColumEditable', true(1, size(raw,2)));
5 个评论
Walter Roberson
2018-6-23
It is not possible to directly write to specific cells of a uitable. All you can do is create a numeric array (if your data is pure numbers) or cell array (if you have some non-numeric entries) and put things where you want in that array, and then set the resulting array as the Data property of the uipanel.
uitable is not a spreadsheet; you cannot address parts of it, and there are no macros, and it is not very flexible about formatting.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Migrate GUIDE Apps 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!