how do i present the variable W with the 2 digits after the decimal point?
Show older comments
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)
Answers (1)
Purushottama Rao
on 14 May 2015
Edited: Purushottama Rao
on 14 May 2015
format bank
w
5 Comments
Purushottama Rao
on 14 May 2015
BEFORE DISPLAYING YOUR RESULT, use format bank command
Idan Nagar
on 14 May 2015
Purushottama Rao
on 14 May 2015
Edited: Purushottama Rao
on 14 May 2015
You may use as well
sprintf('%.2f', W);
Purushottama Rao
on 14 May 2015
>> w=1.2345
w =
1.2345
>> sprintf('%.2f',w)
ans =
1.23
>>
Walter Roberson
on 14 May 2015
double() the symbolic number to get floating point.
Categories
Find more on Multirate Signal Processing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!