How to use integer or other datatype condition in if Block, Simulink?
6 ビュー (過去 30 日間)
古いコメントを表示
Hello,
I want to use condition like if (u ==1), IF block has single/double data type by default, so whenever I generate the code from simulink model, this condition shows u == 1.0F How can I change data type to Int or Boolean so in the autocode it will show u == 1.0 ??
Or any other way to implement if elseif condition where I could change the data type of if condition in Simulink?
Thanks in advance for your answer.
0 件のコメント
採用された回答
Fangjun Jiang
2024 年 3 月 24 日
Try this, Use a Relational Operator block where you can specify any data type for the inputs. Specify the output data type as boolean which is the default. Feed this to the IF block where the condition is if (u)
12 件のコメント
Fangjun Jiang
2024 年 3 月 27 日
Update:
I reported the incorrect documentation to the Mathworks tech support. I have been notified that an update/correction of the document will be coming soon.
その他の回答 (0 件)
参考
カテゴリ
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!