How can I get multiple data(*text*) form single edit text in MATLAB guide?
7 views (last 30 days)
I have a GUI with several edit text and push buttons. a specific edit text which call Rx_name, i set edittext to 10, where user can enter different names.
What I want is to stor the data in one row
name=[name1 name2 name3 ....]
my code is
function pushbutton1_Callback(~, ~, handles)
% hObject handle to pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
rxs = rxsite('Name', Rx_name,...
I got different values for Rx_lat, Rx_lon and Rx_height but I can't get different *text* for Rx_name wher it should be text not number
Alamanda Ponappa Poovaya on 10 Aug 2021
I understand you want to store your text data from an edit text input in one row.
This snippet which you have written
wthis will store the entire edit text as one continuous string. Assume the edit text was name1 name2 name3, Rx_name will be ‘name1 name2 name3’, a single string.
In order to store them separately, you can use the split command
Rx_name_split = split(Rx_name)
, which splits at all white spaces.
The result Rx_name_split will be a cell array with name1,name2 and name3 stored as individual elements. You can index a cell array like this:
or so on