Weird problem with fix.
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Guys do you know why fix on matlab 2017a is behaving weirdly. Pls have a look on the attached pic.This is not photoshopped.
0 Kommentare
Antworten (2)
Star Strider
am 22 Jul. 2017
Bearbeitet: Star Strider
am 22 Jul. 2017
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 Kommentare
Siehe auch
Kategorien
Mehr zu Matrix Indexing finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!