Compact data uncertainty format
by Peter Mao
25 Feb 2006
(Updated 09 Jun 2006)
given data and uncertainty, this program reformats the number into parenthetic notation.
|
Watch this File
|
| File Information |
| Description |
example: reformats '10.3 +- .2' as '10.3(2)'.
usage: >> format_data(10.3,0.2)
ans = '10.3(2)'
Often, it is more compact to represent the uncertainty of a datum by placing the uncertainty in parentheses with the uncertainty understood to apply to the final digit(s) of the datum. This program achieves such formatting, properly accounting for the decimal point, where applicable. The output can be set in standard decimal, scientific, engineering or metric formats. For scientific or engineering, LaTeX formatting is also an option. The number of digits in the uncertainty is also an option (default = 1). If anyone has better suggestions on the name of this function or the title, please let me know!! |
| MATLAB release |
MATLAB 7.1.0 (R14SP3)
|
|
Tags for This File
|
| Everyone's Tags |
|
| Tags I've Applied |
|
| Add New Tags |
Please login to tag files.
|
| Comments and Ratings (2) |
| 15 Nov 2007 |
Rolf Heidemann
|
|
|
| 30 Nov 2007 |
peter mao
|
|
|
| Updates |
| 08 Mar 2006 |
type-o's in description, summary got cut off. |
| 21 Mar 2006 |
made changes suggested by M-Lint to make it run faster. EXIST specifies 'var' and REGEXP specifies 'once' now.
The HELP section does include examples, despite the code metrics complaint!! |
| 09 Jun 2006 |
Code updated to properly handle negative numbers. |
|
Contact us at files@mathworks.com