How do I get mathematical answer as a whole number instead of numerator and denomintor?

조회 수: 12 (최근 30일)
I am calculating the co-ordinates and I am getting the answers as xL1 =
2232746079664914432/16414873036725325
-5183899564262633692302747613221/36096687544692468638705254400
I want the answer as a whole number like the below:
136.0197
-143.6115
instead of that fraction form. How do I get it?
  댓글 수: 1
Geoff Hayes
Geoff Hayes 2014년 6월 6일
Try executing format short in the Command Window to change the format of the numbers. format rat, for format rational, may be the reason behind why you are observing the rational numbers. Out of curiosity, how was xL1 generated?

댓글을 달려면 로그인하십시오.

채택된 답변

Star Strider
Star Strider 2014년 6월 6일
See the documentation for vpa and double (link at the end of the vpa page).

추가 답변 (1개)

Emmanuel
Emmanuel 2014년 6월 6일
double() gave mke the answer! thank you!

카테고리

Help CenterFile Exchange에서 Linear Algebra에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by