Width & Precision Number Formatting in Documentation
显示 更早的评论
In the Matlab documentation for sprintf (https://www.mathworks.com/help/matlab/ref/sprintf.html), in the Precision section, the second example shown is:
Example: The input arguments ('%6.4f',pi) are equivalent to ('%.*f',6,4,pi)
However, this is not the answer I see when trying it myself. I get 3.1416 for the first set of inputs and 4.000000 for the second set of inputs. I wonder if they meant to use a '*' instead of a '6' in the first set of inputs? If this is indeed an error, it exists in documentation for other functions as well (e.g., fprintf). Would anyone be able to help clarify?
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Discrete Math 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!