File Exchange

image thumbnail


version (1.31 KB) by Jordi Palacin
Decodification of engineering representation.

1 Download

Updated 10 May 2005

View License

This function decodes an engineering representation:

[valor,unidad] = eng2num(string_valor)
[0.01,'F'] = eng2num('10mF')
[0.01,''] = eng2num('10m')
0.01 = eng2num('10m')

Also available num2eng

Cite As

Jordi Palacin (2021). eng2num (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (2)

Stephen Cobeldick

Disclaimer: In the end I could not find any FEX submission that gave the correct outputs for the wide range of test-cases that I tried, so I ended up writing my own function. You can find it here:

Stephen Cobeldick

As per its corollary "num2eng" from the same author, this file is also missing an H1 line, has several mlint messages that need attention, uses a "for" loop with a "break" command, and repeats a lot of code. The conversion behavior is substandard, particularly the complete inability to recognize the SI prefixes y, z, a, n, E, Z, and Y. In addition any negative, Inf or NaN value returns an empty numeric without warning, eg: '-1' -> []. E-notation in the number is ignored, and for the prefixes p and f incorrect values are returned, eg: '1 p' -> 1e-9 (should be 1e-12).

This submission needs a major re-write.

MATLAB Release Compatibility
Created with R14
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!