Weird problem with fix.
2 ビュー (過去 30 日間)
古いコメントを表示
Guys do you know why fix on matlab 2017a is behaving weirdly. Pls have a look on the attached pic.This is not photoshopped.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/166234/image.png)
0 件のコメント
回答 (2 件)
Star Strider
2017 年 7 月 22 日
編集済み: Star Strider
2017 年 7 月 22 日
The format displays the value rounded to the nearest integer. The fix function rounds toward zero (for both positive and negative numbers).
Example —
format long g
R1C2 = 3.9999999999
format short g
Q1 = R1C2
Q2 = fix(R1C2)
R1C2 =
3.9999999999
Q1 =
4
Q2 =
3
————————————————————
EDIT — Clarified explanation.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で 3-D Scene Control についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!