Need help with a syntax
1 回表示 (過去 30 日間)
古いコメントを表示
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
0 件のコメント
回答 (2 件)
Image Analyst
2017 年 9 月 4 日
Try int32():
intVariable = int32(doubleVariable);
1 件のコメント
Guillaume
2017 年 9 月 4 日
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.
Guillaume
2017 年 9 月 4 日
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.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Function Creation についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!