How do I get a numerical value from Edit Text at a GUI and use it in same program?
30 views (last 30 days)
Show older comments
Giovani Falcometa
on 25 Aug 2015
Commented: Mohammed Hazim
on 29 May 2022
I'm trying to build a control interface for Lego Mindstorms using Matlab, but I need to read the power, given by the Text Edit box. How can I do that?
0 Comments
Accepted Answer
Walter Roberson
on 25 Aug 2015
str2double(get(handles.editbox_5, 'String')) %replace editbox_5 with actual name of edit box
3 Comments
Mohammed Hazim
on 29 May 2022
That doesn't work!!!
Getting The following error:
Unable to resolve the name 'handles.width'.
Error in gui/ApplyButtonPushed (line 101)
val = str2double(get(handles.width, 'String')) %replace editbox_5 with actual name of edit box
Error in matlab.apps.AppBase>@(source,event)executeCallback(appdesigner.internal.service.AppManagementService.instance(),app,callback,requiresEventData,event) (line 63)
newCallback = @(source, event)executeCallback(appdesigner.internal.service.AppManagementService.instance(), ...
Error while evaluating Button PrivateButtonPushedFcn.
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!