필터 지우기
필터 지우기

format for decimal numbers and no fractional

조회 수: 10 (최근 30일)
Noe alvarado
Noe alvarado 2014년 6월 20일
댓글: Deepak Ramaswamy 2014년 6월 24일
How i can obtain results in decimal format and not in fractional format?
I am using matlab for direct knematic, for example :
For a matrix I expect the following result: A12 =
[ 0, 0, 1, 0]
[ 1, 0, 0, 0]
[ 0, 1, 0, d2]
[ 0, 0, 0, 1]
but matlab show : A12 =
[0, -4967757600021511/81129638414606681695789005144064, 1, 0]
[ 1, 0, 0, 0]
[ 0, 1,4967757600021511/81129638414606681695789005144064, d2]
[ 0, 0, 0, 1]
where i expect a 0 i have a fractional number 4967757600021511/81129638414606681695789005144064

채택된 답변

the cyclist
the cyclist 2014년 6월 20일
I suggest you read
doc format
for complete info on how MATLAB displays to the command window.
If you mean something else, please add more detail to your question, which is very imprecise.
  댓글 수: 5
the cyclist
the cyclist 2014년 6월 22일
I'm not sure what's happening here, and I don't have the Symbolic Math Toolbox, so I can't really test any ideas. I'm guessing that those fractions are the closest representation that MATLAB can get to the actual values, but I don't really know.
Deepak Ramaswamy
Deepak Ramaswamy 2014년 6월 24일
That is the rational representation of the number as computed by the symbolic math toolbox. convert to float using
double(A12)

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

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by