Azzera filtri
Azzera filtri

GUI save data question

1 visualizzazione (ultimi 30 giorni)
Ali
Ali il 6 Mar 2013
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
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.
Ali
Ali il 6 Mar 2013
ok, let me describe the question again. I'm working on a software which is suppose to calculate the fluid property of a piping system. In this program, user has to enter the pipe's property node by node, or for each 100 m. So, I have to save different nodes in one row of matrix. I used a push button to save each node property, but when I'm going to the second node I loose the first node's data. My push button code that has to save data in matrix A is the upper code. Just wondering to know what is my code problem that will use previous data in each new press.
I hope could describe well my problem. Thanks again Jan

Accedi per commentare.

Risposte (0)

Categorie

Scopri di più su Introduction to Installation and Licensing in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by