How can I implement a function from a FROM block with mulltiple input signals
3 ビュー (過去 30 日間)
古いコメントを表示
implementing a function by itself works fine as shown in first picture.(bottom highlighted)
When I implement the same method from a FROM block with 3 signals i get an error.
1 件のコメント
回答 (1 件)
Brahmadev
2023 年 9 月 12 日
Hi Brian,
I understand that you are trying to input an array into the "MATLAB function" block and have encountered the error "Index Expression out of bounds". The probable cause of this error is the size of the input "u" from the "From" block. The input has dimensions 1x1.
If you would like to use a concatenation of "Signal1", "Signal2" and "Signal3" as the input to the "MATLAB Function block", connect them to a "Bus Creator" block and then send them to the "Goto" block.
Also, for troubleshooting issues related to dimension mismatch or “Out of bounds” errors, you can turn on “Signal Dimensions” in Debug->Information Overlays.
You can also refer to the MathWorks documentation for “Bus Creator” and “Goto” blocks below for more information.
- https://www.mathworks.com/help/simulink/slref/buscreator.html
- https://www.mathworks.com/help/simulink/slref/goto.html
Hope this helps!
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Event Functions についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!