How do you force answers to be displayed in decimal format instead of as a fraction? Here is an example
syms CD
>> cross(ac,CD*Ucd)
ans =
[ (23089284507395629*CD)/144115188075855872, (43129010120971187*CD)/450359962737049600, (14811997678849777*CD)/56294995342131200]
Eval often works but not always,
eval(ans)
ans =
[ (5772321126848907*CD)/36028797018963968, (2695563132560699*CD)/28147497671065600, (925749854928111*CD)/3518437208883200]
It is a different fraction, but still a fraction.
Thanks.
Tom
|
|
0
|
|
|
|
Reply
|
Tom
|
6/4/2010 2:38:04 PM |
|
Tom wrote:
> How do you force answers to be displayed in decimal format instead of as
> a fraction? Here is an example
> syms CD
>>> cross(ac,CD*Ucd)
> ans =
> [ (23089284507395629*CD)/144115188075855872,
> (43129010120971187*CD)/450359962737049600,
> (14811997678849777*CD)/56294995342131200]
vpa() for specific decimal precision, or double() for binary floating point
|
|
0
|
|
|
|
Reply
|
Walter
|
6/4/2010 2:52:38 PM
|
|