How I input an array of numbers in GUI text box?
29 views (last 30 days)
Show older comments
Indu S on 12 Mar 2020
Answered: Alex Mcaulley on 12 Mar 2020
I want to enter an array of numbers in the TEXTBOX in GUI. In my code I'm converting the array of strings to array of numbers.
In the textbox when I give input as- [1 2 3 4 5].
Im getting x Nan.
and get(handles.edit1,'string') = '[1 2 3 4 5]'.
What I want is x=[1,2,3,4,5]. Please suggest a solution. Thanks in advance
Alex Mcaulley on 12 Mar 2020
Use str2num instead:
Find more on Migrate GUIDE Apps in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!