How to manipulate single cell on uitable from MATLAB GUI

1 view (last 30 days)
UITABLE's Single Cell Manipulation
Good day! I am currently working on excel spreadsheet that must be displayed on MATLAB GUI through the uitable. I would like to consult on the following matters regarding the uitable's single cell manipulation:
1. How to save an entry from an edit box that must be saved on a single cell on excel spreadsheet? I have tried these codes but it seems that it saves each character of the data on the different cells.
txt = get(handles.edit1, 'string');
xlswrite('a.xls',txt,1,'C2');
2. How to call the string/numerical value of a single cell from excel spreadsheet to matlab gui uitable's specific cell? For an example, the entry of excel's B2 cell is '100', then on uitable's A1 cell, '100' must be displayed.
3. How to add or subtract a certain factor to a single cell on uitable using a push button? (The data was retrieved from the excel spreadsheet and after the addition/subtraction, the data on the uitable cell is saved to the excel) I have tried the following codes. It can already add/subtract '1' but the entire column of data on the uitable is being affected. Also, it cannot overrida the data on excel yet.
%subtract for push button callback function
data = get(handles.uitable1, 'Data');
data = data - 1;
set(handles.uitable1, 'Data', data);
%add for push button callback function
data = get(handles.uitable1, 'Data');
data = data + 1;
set(handles.uitable1, 'Data', data);
Thank you to those who will respond.

Answers (0)

Community Treasure Hunt

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

Start Hunting!