Effacer les filtres
Effacer les filtres

how do i present the variable W with the 2 digits after the decimal point?

2 vues (au cours des 30 derniers jours)
Idan Nagar
Idan Nagar le 14 Mai 2015
Commenté : Walter Roberson le 14 Mai 2015
i=0.15; v=24;
c=25*10^-6;
R=140; L=260*10^-3;
syms W
eqn = i==v/sqrt((R^2)+(W*L-1/W*c)^2);
W = solve(eqn,W);
w= round(W)

Réponses (1)

Purushottama Rao
Purushottama Rao le 14 Mai 2015
Modifié(e) : Purushottama Rao le 14 Mai 2015
  5 commentaires
Purushottama Rao
Purushottama Rao le 14 Mai 2015
>> w=1.2345
w =
1.2345
>> sprintf('%.2f',w)
ans =
1.23
>>
Walter Roberson
Walter Roberson le 14 Mai 2015
double() the symbolic number to get floating point.

Connectez-vous pour commenter.

Community Treasure Hunt

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

Start Hunting!

Translated by