How can I make my simulink matlab function compute internally in single format instead of double
3 ビュー (過去 30 日間)
古いコメントを表示
I have a simulink model that is consisting of combined sub-blocks, for one of those blocks I created using the matlab function block, this block will have inputs that are of type 'single' and outputs that are also of type 'single'.
How can I specify when I am writing the code for the matlab function that the inputs and outputs will be of type 'single' and that I want all the computations inside to be done based on that instead of the default which is assuming that inputs, outputs and internal computations are of type 'double' ?!
0 件のコメント
回答 (1 件)
Iain
2013 年 5 月 30 日
The simple answer is to ensure that any constants you use internally in the function are single format.
single * single = single...
1 件のコメント
Kaustubha Govind
2013 年 5 月 30 日
Also, the inputs to the block must be created to be of single datatype.
参考
カテゴリ
Help Center および File Exchange で Simulink Functions についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!