Find Numbers in a String
Version 1.0.0.0 (4.7 KB) by
Edward Zechmann
Finds flaoting point numbers in a string including: complex, real, integers, and currency (dollars).
find_nums finds all of the numbers in a string and returns an numeric array, nums, with all of the numbers that were found. By specifying flag as 1,2,3 or 4, the program will find: complex numbers, real numbers, integers, or currency (dollars) respectively.
Also a cell array of the matched string is returned. The cell array maybe useful for reprinting numbers in a new table, using a different parsing method to extract the numbers, or reformatting such as removing spaces.
Cite As
Edward Zechmann (2026). Find Numbers in a String (https://se.mathworks.com/matlabcentral/fileexchange/21618-find-numbers-in-a-string), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Created with
R2007b
Compatible with any release
Platform Compatibility
Windows macOS LinuxCategories
Find more on String Parsing in Help Center and MATLAB Answers
Tags
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
| Version | Published | Release Notes | |
|---|---|---|---|
| 1.0.0.0 |
