str2doublef

Fast approximate string to double parsing for real or complex numbers.
3 Downloads
Updated 28 May 2022

View License

Fast approximate string to double or complex parsing for %f and %e formatted numbers such as '25.423', '0.0069', '+1.2', '-124.67', '2.0e-10', '6.02214076e23', and '23 + -5i', 'i', 0 + -i', '-25e+5 + -5e-2i', '10i', '5i-2', '2 +76i', etc. For complex numbers the relevant numeric substrings may appear in either a real then imaginary or imaginary then real order. Parsing is performed from right to left and issues related to overflow, underflow, and potential loss of precision are ignored. The intent is to provide a fast and relatively accurate means of parsing formatted real or complex numbers in a %f or %e format, represented as strings of characters, for a broad range of values, but not an attempt to get the maximum precision for the machine representation of a double precision numeric value from a string.

Cite As

Kevin Gehringer (2024). str2doublef (https://www.mathworks.com/matlabcentral/fileexchange/112345-str2doublef), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2022a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Tags Add Tags

Community Treasure Hunt

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

Start Hunting!
Version Published Release Notes
1.1.0

Fixed an error in the test data generation function and fixed a few typos.

1.0.0