how to increse no digits after decimal point?

2 次查看(过去 30 天)
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 个评论
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 中查找有关 Logical 的更多信息

标签

产品


版本

R2016a

Community Treasure Hunt

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

Start Hunting!

Translated by