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

采纳的回答

Walter Roberson
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 个评论
VBBV
VBBV 2018-6-23
Ok, I got it now ...
but how do I write the data contents to specific cell/s of uitable after I read it using xlsread
Walter Roberson
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 CenterFile Exchange 中查找有关 Migrate GUIDE Apps 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by