Assign values to an "Editor Text" box using manual input or a push button
Mostrar comentarios más antiguos
I want to allow user to insert different numbers in an editor text box to be used further in the code. But I also want to add a push button to restore a default value to that parameter (and show that number in the edit text box) when needed. How can I do this? My callback functions are as follows.

function GLP_fsize_val_Callback(hObject, eventdata, handles)
handles.GLP_fsize_val=str2double(get(hObject,'String'));
guidata(hObject, handles);
[similar function for sigma]
function Default_GLF_Callback(hObject, eventdata, handles)
set(handles.GLP_fsize_val,'string',handles.defaults.GLP_fsize_val);
set(handles.GLP_sigma_val,'string',handles.defaults.GLP_fsize_val);
guidata(hObject, handles);
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Characters and Strings en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!