Info

This question is closed. Reopen it to edit or answer.

How can I get MATLAB to return Alpha1=4

1 view (last 30 days)
Nicholas McPherson
Nicholas McPherson on 21 Jan 2016
Closed: MATLAB Answer Bot on 20 Aug 2021
Write a single MATLAB statement that will accomplish the stated purpose. Assume a text string TS1 has already been defined. Place the numeric index of the first alphabetic character in TS1 into Alpha1. Example: TS1='%@3Gb6' returns Alpha1=4.
  2 Comments
Joshua McMillan
Joshua McMillan on 22 Jan 2016
That link is a link to a similar question, but it is not the same question

Answers (1)

Star Strider
Star Strider on 21 Jan 2016
This will work:
TS1='%@3Gb6';
Alpha1 = regexp(TS1, '[A-Za-z]')
Alpha1 =
4

This question is closed.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!