GUI save data question
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commenti
Jan
il 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.
Risposte (0)
Vedere anche
Categorie
Scopri di più su Introduction to Installation and Licensing in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!