GUI save data question
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Jan
le 6 Mar 2013
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.
Réponses (0)
Voir également
Catégories
En savoir plus sur Introduction to Installation and Licensing dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!