Borrar filtros
Borrar filtros

how to add data to the new row

5 visualizaciones (últimos 30 días)
ikhsan
ikhsan el 22 de Jun. de 2013
Respondida: matlablearner el 25 de Jul. de 2014
I have a code like this when I want to enter data a second, I want to automatically written data on the next line
proses_Callback function (hObject, eventdata, handles)
a = str2num (get (handles.a, 'string'));
b = str2num (get (handles.b, 'string'));
c = str2num (get (handles.c, 'string'));
d = str2num (get (handles.d, 'string'));
e = str2num (get (handles.e, 'string'));
f = str2num (get (handles.f, 'string'));
num = [a, b, c, d, e, f];
mydata = xlswrite ('myfile.xls', num);

Respuestas (2)

Azzi Abdelmalek
Azzi Abdelmalek el 22 de Jun. de 2013
num = [a; b; c;d; e; f];
  3 comentarios
Azzi Abdelmalek
Azzi Abdelmalek el 22 de Jun. de 2013
Editada: Azzi Abdelmalek el 22 de Jun. de 2013
In opening function add this:
handles.num=[];
In your proses callback function add:
num=handles.num
num = [num;a, b, c, d, e, f];
handles.num=num;
ikhsan
ikhsan el 22 de Jun. de 2013
hai malek...
I have tried suggestions from you but I still find fault
I send my project to you I want to add data to the next row
please see and where is my fault

Iniciar sesión para comentar.


matlablearner
matlablearner el 25 de Jul. de 2014
Hi,
Before you set the Data of the uitable, get the previous data and concatenate it with the new data
existingData = get(handles.uitable,'Data'); % Get the existing data
newData = [existingData; newdata]; % Append the data
set(handles.uitable,'Data',newData); % Set the appended data to the table.
Hope it helps.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by