Info

This question is closed. Reopen it to edit or answer.

How to exact single precision data and operations

1 view (last 30 days)
Matthew
Matthew on 28 Jul 2013
Closed: MATLAB Answer Bot on 20 Aug 2021
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?

Answers (1)

Matt J
Matt J on 28 Jul 2013
Edited: Matt J on 28 Jul 2013
You can convert anything to single using the SINGLE command.
>> a=single(1); whos a
Name Size Bytes Class Attributes
a 1x1 4 single

Products

Community Treasure Hunt

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

Start Hunting!