Your Task Follow the steps below to create and corvert between symbolio and doubleiprecision values. str2sym( ( 2 x p ( 2 ) " ) The reoult is equlvatient to es ym abeve. However, there are two coenexon situations vhere the double-precition volues are nocostary: - When using MatuAs functions that expoct numeric (double) valies as inqut - When code performance is reduced by symbolic computations duo to the need to tetain exact results of complex andioc repeated calculations In these cases, wh can carreit a symbolic quantity to its comesponding numeric watue using the oguble tunction as in the code below dauble(esim) function, as in the example codo beiow. For example, the code below will result in the symbolic variable edpable = exp ( 2 ) synts x f ( x ) = cxp ( x ) esyz = f ( 1 ) Symbolic expressiots are wheful when an eract answer is noedod, or when round-ot emor due to numenic approvimation is to be avoded. and are not a numeric approximation represented using a decimal with a foced number of digis. like 5 1 of 2 1 + 5 , It is important io note that these numbess and numeric oxpressions are stll symbolic, in that they that represent an exact mathematical euantify. Converting Between Symbolic and Numeric Values My Sclutions After evaluating a symbolic funclion or substituting numetic values into a symbolc exgression, the final result is otsen a number, Jke -2.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |