This question is closed. Reopen it to edit or answer.
Repeated scalar entries to a gui edit box should be stored in an array/vector format
1 view (last 30 days)
In my gui,i have a popup menu where the user selects size of array.In the edit box below there is an edit box in which user enters a scalar entry & presses enter,then the next entry that he types at that edit box should be stored as 2nd entry of a vector & so on.
- If user enters 100 at editbox --- array value = 
- next user enters 200 at editbox --- array value = [100 200]
- ....so on.
- If user exceeds size as set in popup --- array value = .
% At gui opening function:-
%-------other part of code-----
% at editbox callback function
i = evalin('base',i);
array = evalin('base','array');
size = get(handles.popup1,'User Data'); % reads size of array to be set from popup menu
if length(array) < size
array(i) = str2double(get(hObject,'String'));
i = i+1;
Is there any better way to do this ?Without referencing to the base workspace each time ?