how to increse no digits after decimal point?

조회 수: 1 (최근 30일)
rajesh kumar
rajesh kumar 2018년 9월 1일
편집: Stephen23 2018년 9월 4일
in matlab coding i am getting ans =0.0012 i want to getting ans =0.001234903423 what to do please suggest me
  댓글 수: 1
jonas
jonas 2018년 9월 1일
편집: jonas 2018년 9월 1일
You can always use format long, but I don't know if you can specify the number of decimals more than that.

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

채택된 답변

KALYAN ACHARJYA
KALYAN ACHARJYA 2018년 9월 1일
편집: KALYAN ACHARJYA 2018년 9월 1일
fprintf('%.12f', ans) %Upto 12 floating points, you can change the value range
  댓글 수: 3
KALYAN ACHARJYA
KALYAN ACHARJYA 2018년 9월 1일
편집: KALYAN ACHARJYA 2018년 9월 1일
fprintf('%.10f', ans)
Stephen23
Stephen23 2018년 9월 4일
편집: Stephen23 2018년 9월 4일
"Upto 12 floating points"
Why 12? Where does this limit come from? I don't see this limit mentioned anywhere in the fprintf help, nor is it related to the precisions of either double or single floating point numbers:
When I try 15 decimal digits, it works just fine:
>> X = 0.123456789012345;
>> fprintf('%.15f\n',X)
0.123456789012345
Where did you get this "Upto 12 floating points" limit from?

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

추가 답변 (0개)

카테고리

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

태그

제품


릴리스

R2016a

Community Treasure Hunt

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

Start Hunting!

Translated by