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!