strnums

Matlab code to pull numbers out of strings
4 Downloads
Updated 13 Mar 2019

strnums is a function to scan through a string and isolate just the
numbers before converting to a number.
Optional handling choices are as follows
1. Concatenate all numeric characters together to convert to a
single number, disregarding any separating characters. Leading
zeros are lost except where only zeros exist.
2. Concatenate only adjacent numeric characters, returning a
number per separate block. Leading zeros in any block are lost
except where only zeros exist
3. Concatenate adjacent numeric characters, ignoring undefined
separator characters, but grouping characters according
the characters listed in inputs
4. Return each digit separately

Cite As

Renwick Beattie (2024). strnums (https://github.com/ReneBT/strnums), GitHub. Retrieved .

MATLAB Release Compatibility
Created with R2014a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Numeric Types in Help Center and MATLAB Answers
Tags Add Tags

Community Treasure Hunt

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

Start Hunting!

Versions that use the GitHub default branch cannot be downloaded

Version Published Release Notes
1.0.0

To view or report issues in this GitHub add-on, visit the GitHub Repository.
To view or report issues in this GitHub add-on, visit the GitHub Repository.