Short format display after using solve command

조회 수: 6 (최근 30일)
manish sharma
manish sharma 2012년 8월 10일
댓글: Walter Roberson 2018년 9월 29일
Hi,
Although I have chosen the short format in the code and command window display preferences. The results after using a "solve" command are displayed as:
y =
7770/23 - (32083660183526053*R)/12947848928690176000
Can anybody help me so that I can view the numerical values in short format? Like:
y = 337.83 - 0.0024779*R
Thanks

채택된 답변

Walter Roberson
Walter Roberson 2012년 8월 10일
Use vpa()
  댓글 수: 3
Gombo Choigaalaa
Gombo Choigaalaa 2018년 9월 29일
편집: Walter Roberson 2018년 9월 29일
>> x=3^4/(2^3+2-4.5);
>> x=14.7273 -looks ok but not short.
>> vpa(x)
ans =
14.727272727272727272727272727273 -is not short at all LOL
Walter Roberson
Walter Roberson 2018년 9월 29일
By default vpa() pays attention to the current digits() setting, which defaults to 32. You can specify how many digits you want at the time of the vpa() call. For example,
>> vpa(x,5)
ans =
14.727

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

추가 답변 (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