How to exact single precision data and operations

Hi,
Matlab generally uses doubles but for my ARM-Cortex-M4 implementation it would be much better for me if using floats. For that I mean generate variables like 'float x' or 'real32_T x' but as well ass constants like 'y = x * 3.0f'
Can I achieve that?

답변 (1개)

Matt J
Matt J 2013년 7월 28일
편집: Matt J 2013년 7월 28일

0 개 추천

You can convert anything to single using the SINGLE command.
>> a=single(1); whos a
Name Size Bytes Class Attributes
a 1x1 4 single

이 질문은 마감되었습니다.

질문:

2013년 7월 28일

마감:

2021년 8월 20일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by