DIsplay numbers in an expression in scientific notation
54 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Sita
le 22 Nov 2022
Commenté : Walter Roberson
le 23 Nov 2022
I have an expression that I'm plugging a bunch of values into and I would like for matlab to show me the result with the constants in scientific notation. By default, it shows the constants as big fractions that aren't as easy to work with. Here's what I mean:
syms L1 L2 C1 C2 C3 Rl s;
L1=10e-9;
L2=500e-12;
C1=600E-12;
C2=2E-9;
C3=100E-12;
Rl=2;
H_P_V2DivI1 = (C2*Rl*s + 1)/(C1*C2*L1*s^3 + C1*C2*Rl*s^2 + (C1 + C2)*s)
H_P_V2DivI1 =
((4835703278458517*s)/1208925819614629174706176 + 1)/((8362779449448985*s^3)/696898287454081973172991196020261297061888 + (3115378115120897*s^2)/1298074214633706907132624082305024 + (785801782749509*s)/302231454903657293676544)
Is there a way to display this expression using scientific notation instead? Thanks!
0 commentaires
Réponse acceptée
Walter Roberson
le 22 Nov 2022
syms L1 L2 C1 C2 C3 Rl s;
L1=10e-9;
L2=500e-12;
C1=600E-12;
C2=2E-9;
C3=100E-12;
Rl=2;
H_P_V2DivI1 = (C2*Rl*s + 1)/(C1*C2*L1*s^3 + C1*C2*Rl*s^2 + (C1 + C2)*s)
vpa(H_P_V2DivI1, 16)
3 commentaires
Walter Roberson
le 23 Nov 2022
yes optional second parameter is the number of digits. Otherwise it uses the current digits() setting
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Logical dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!