About 3 significant digit?

5 views (last 30 days)
Ls
Ls on 11 Sep 2021
Answered: Jan on 11 Sep 2021
How do i present the output in 3 significant digit?

Answers (1)

Jan
Jan on 11 Sep 2021
fprintf('%.3g\n', pi)
3.14
fprintf('%.3g\n', pi * 1e6)
3.14e+06
fprintf('%.3g\n', pi * 1e-6)
3.14e-06

Categories

Find more on Image Processing Toolbox in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!