How to input an array in my simulink model?
20 ビュー (過去 30 日間)
古いコメントを表示
I want to use an array as a parameter of my c function caller and have it as a bus element. I try to define it in my data dictionary but it does not show up as a data type for my bus element.
How do I properly define an array in simulink modeling?
0 件のコメント
回答 (1 件)
Aabha
2025 年 2 月 28 日
I understand that you want to pass an array into a C function block within a Simulink model, and this array is part of the bus structure defined in the data dictionary.
The “C-Caller” block allows to configure input ports and parameters based on the data types that are passed as input arguments to the blocks. In order to pass a “bus element” to a block, the “Type” field in the “C-Caller” interface needs to be configured as a Bus object.
Alternatively, if the data needs to be passed as an array, and not as a bus element, the “Bus Selector” block can be used. Configure the input of the “Bus Selector” block as the bus object and configure the output as the desired array. The output of the “Bus Selector” block can then be connected as an input to the “C Caller” block.
Please refer to the following documentation links for more information about the “C-Caller” and the “Bus Selector” block.
I hope this helps.
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!