Need help with a syntax

1 Ansicht (letzte 30 Tage)
hasan alhussaini
hasan alhussaini am 4 Sep. 2017
Beantwortet: Guillaume am 4 Sep. 2017
basically i'm converting an idl syntax to MATlab the idl syntax is known as "fix" which "The FIX function converts a given expression to an integer type. Optionally, the conversion type can be specified at runtime, allowing flexible runtime type-conversion to arbitrary types."
i think its "real" but not sure if theres other alternatives
Thanks

Antworten (2)

Image Analyst
Image Analyst am 4 Sep. 2017
Try int32():
intVariable = int32(doubleVariable);
  1 Kommentar
Guillaume
Guillaume am 4 Sep. 2017
It's actually not documented in matlab what the rounding behaviour of the intxx functions actually is. If it is the same as C, then it does indeed do the same as fix.

Melden Sie sich an, um zu kommentieren.


Guillaume
Guillaume am 4 Sep. 2017
The fix function is also available in matlab, if that's what you're asking.
Type information is usually not important in matlab. It's got better in recent releases but there's still plenty of functions that don't work with integer types.

Kategorien

Mehr zu Function Creation 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!

Translated by