Function to round variable to number of significant figures

Version 1.0.0.0 (12.2 KB) by Niel
This function (or Simulink subsystem) rounds any variable to a given amount of significant figures.
262 Downloads
Updated 20 Aug 2013

View License

This function can be incorporated into a Simulink model to round a variable to a predetermined number of significant figures. The constant at the bottom is n+1, where n is the number of significant figures required.

Cite As

Niel (2024). Function to round variable to number of significant figures (https://www.mathworks.com/matlabcentral/fileexchange/43143-function-to-round-variable-to-number-of-significant-figures), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2012b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Modeling in Help Center and MATLAB Answers

Community Treasure Hunt

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

Start Hunting!
Version Published Release Notes
1.0.0.0