Hello everyone,
I am creating a GUI where a variable number of edit box is created based on the number entered from the user. Then I need to get the data written in each edit box. To do that I created a cycle for where N edit text boxes are generated using uicontrol.
for K=1:N edit(K) = uicontrol('Style', 'edit', 'String', '', 'Units', 'Pixels', 'Position', [175 ypos 110 30],'callback',@thickness); end
The problem is that I cannot get the values from each box because it gives me only the value written in the last box.
function pushbutton2_Callback(hObject, eventdata, handles)% hObject handle to pushbutton2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
function []=thickness(hObject, eventdata, handles)val=get(hObject,'string')setappdata(0, 'value',val);
Do you have any suggestion how to save the data from all the boxes for example in a array? Thank you in advance
Best Answer