detect nth character in a string
51 views (last 30 days)
Show older comments
hello all masters,
i have a variable string for example a = 'c13Maya'
how do i detect the 2nd and 3rd characters of the string ?? the result will give 13 as answer..
any suggestion will be appreciated
thank u,
-Maya-
0 Comments
Accepted Answer
Dr. Seis
on 22 Jan 2012
If you want the result to also be a string, then:
b = a(2:3);
If you want the result to be a number, then:
b = str2double(a(2:3));
4 Comments
More Answers (0)
See Also
Categories
Find more on Data Type Identification 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!