input alphabet and numbers
6 views (last 30 days)
Show older comments
Theodoros Siapakas
on 24 Oct 2018
Commented: Theodoros Siapakas
on 25 Oct 2018
how can I give an entry order numbers and letters together and after reading only their numbers for doing?
such as
x=input('alpanub')
x=100a50b
y=100
c=50
2 Comments
Erivelton Gualter
on 25 Oct 2018
Run the following code, it may give you some insight
name = input('Enter with input: ','s');
name_binary = isletter(name);
idx = find(name_binary == 0);
str2num(name(idx))
Accepted Answer
Akira Agata
on 25 Oct 2018
How about the following?
str = input('Enter with input: ','s');
c = regexp(str,'\d+','match');
output = str2double(c);
More Answers (0)
See Also
Categories
Find more on Logical 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!