GUI save data question
1 次查看(过去 30 天)
显示 更早的评论
Hi,
I'm developing a GUI program that contain a push button, each time that user pushes the button, new raw will be generate in the main matrix and the variables save in the matrix my problem is when I'm adding new data, I loose all my previous data, can you please help me to find my code's problem?
function next_Callback(hObject, eventdata, handles)
i = str2double(get(handles.node_number,'string'));
x = str2double(get(handles.x_value,'string'));
y = str2double(get(handles.y_value,'string'));
j=1;
le_value=sqrt(x^2+y^2);
set(handles.le_value,'string',le_value);
A(i,j)=i;
A(i,2)=x;
A(i,3)=y;
A(i,5)=le_value;
A
handles = guidata(hObject);
handles.A = A;
guidata(hObject, handles);
set(handles.node_number,'string',i+1);
set(handles.x_value,'string',0);
set(handles.y_value,'string',0);
set(handles.le_value,'string',0);
2 个评论
Jan
2013-3-6
The question is not clear. Please use dots to separate the sentences. Which variable is overwritten?
As in your other thread, setting the 'string' property to a numerical value is not sufficient. As the name says, strings are required.
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Introduction to Installation and Licensing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!