Write 32-bit float Simulink variable to file?

6 ビュー (過去 30 日間)
Danijel Domazet
Danijel Domazet 2021 年 4 月 28 日
回答済み: Pratyush Roy 2021 年 5 月 13 日
I am running a Simulink sinulation.
I'd like to capture a 32-bit float variable to file.
It would be a simple binary raw file with no header, but just 32-bit float values inside file.
output.f32

回答 (1 件)

Pratyush Roy
Pratyush Roy 2021 年 5 月 13 日
Hi Danijel,
There is a Simulink block called Binary File writer which can be used to write binary files. You can go through the documentation link here for further details on how this block works.
In case you are working with a variable which is not 32-bit float but want to convert it to a 32-bit float value, you can use the data type conversion block for typecasting the variable to a single data type which is a 32-bit single-precision floating point number according to IEEE Standard 754. You can refer to the link here for the documentation on the data type conversion block.
Hope this helps!

カテゴリ

Help Center および File ExchangeEvent Functions についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by