Prev: [SIMULINK] can i use buffer and unbuffer for RTL generation?
Next: Saving and Loading Objects from Class Hierarchies
From: Tom on 4 Jun 2010 10:38 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
From: Walter Roberson on 4 Jun 2010 10:52
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 |