About 3 significant digit?

How do i present the output in 3 significant digit?

Réponses (1)

Jan
Jan le 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

Catégories

En savoir plus sur System Composer dans Centre d'aide et File Exchange

Produits

Question posée :

Ls
le 11 Sep 2021

Réponse apportée :

Jan
le 11 Sep 2021

Community Treasure Hunt

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

Start Hunting!

Translated by