Info

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

Extracting numbers from Text document

1 view (last 30 days)
Sivakumaran Chandrasekaran
Closed: MATLAB Answer Bot on 20 Aug 2021
Hi, I have a text document which has the values a5229si. I should get the output as 5. Can anyone reply me the code.
Regards.,
Siva
  2 Comments
TAB
TAB on 30 Apr 2012
How data is formated in your text document.
Is it contains only a5229si ?

Answers (1)

Andrei Bobrov
Andrei Bobrov on 30 Apr 2012
regexprep(str,str,'5')
  1 Comment
Sivakumaran Chandrasekaran
I get different answer even if i use the same command which you gave. instead of '5' i mentioned 'z'...

Tags

Community Treasure Hunt

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

Start Hunting!