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 visualizaciones (últimos 30 días)
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

Respuesta aceptada

Walter Roberson
Walter Roberson el 23 de Jun. de 2018
[~, ~, raw] = xlsread('YourFile.xls');
Now raw will contain headers and all.
h = uitable('data', raw, 'ColumEditable', true(1, size(raw,2)));
  5 comentarios
VBBV
VBBV el 23 de Jun. de 2018
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 el 23 de Jun. de 2018
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.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Migrate GUIDE Apps en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by