how to add data to the new row

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);

답변 (2개)

Azzi Abdelmalek
Azzi Abdelmalek 2013년 6월 22일

0 개 추천

num = [a; b; c;d; e; f];

댓글 수: 3

ikhsan
ikhsan 2013년 6월 22일
thank you
but..I do not mean it
I mean the add new data if i am input second data [a,b,c,d,e,f] from handles.edittext
please help me
Azzi Abdelmalek
Azzi Abdelmalek 2013년 6월 22일
편집: Azzi Abdelmalek 2013년 6월 22일
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 2013년 6월 22일
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

댓글을 달려면 로그인하십시오.

matlablearner
matlablearner 2014년 7월 25일

0 개 추천

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.

카테고리

도움말 센터File Exchange에서 Data Type Conversion에 대해 자세히 알아보기

태그

질문:

2013년 6월 22일

답변:

2014년 7월 25일

Community Treasure Hunt

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

Start Hunting!

Translated by