- Check your memory settings: If your system doesn't have enough memory, it could cause issues when dealing with larger matrices. Make sure you have enough RAM and consider adjusting your memory settings in MATLAB/Simulink.
- Consider using a different data type: Depending on the size of your matrices, you may be running into precision issues with the default double data type. Consider using a smaller data type, such as single or int16, if appropriate for your application.
- Try breaking up the matrix operations: If you are encountering issues when multiplying larger matrices, try breaking up the operation into smaller pieces. For example, instead of multiplying a 3x3 matrix by another 3x3 matrix, you could multiply a 3x1 vector by a 1x3 matrix three times.
- Check your code for errors: Make sure your code is correctly written and that there are no typos or syntax errors. Check that your input and output sizes match, and that all necessary libraries are included.
Simulink Compiler errors out with matrix math
5 ビュー (過去 30 日間)
古いコメントを表示
I'm having a problem making a FMU block via Simulink Compiler - I've narrowed the problem down to matrix math. I get an error when I try to multiply a 3 x 3 matrix (or larger). I can multiply 2 x 2 matrices, but once I add a dimension, I get an error. I have "Use algorithms optimized for row-major array layout" checked ... I'm just stumped by this. I can't tell if this is some FMU limitation, or a Simulink Compiler limitation - any help would be welcome
ETA: I tried to compile it normally into an executable using coder, and experienced the same errors. So it's not related to the FMU - for some reason, the compiler doesn't like matrices 3 x 3 or larger ...
0 件のコメント
回答 (1 件)
Aishwarya Shukla
2023 年 3 月 3 日
Hi @Wayne,
It sounds like you are encountering a limitation with the Simulink Compiler when dealing with larger matrices. Without more information on the specific error message you are receiving, it's difficult to provide a specific solution. However, here are a few general suggestions that may help:
参考
カテゴリ
Help Center および File Exchange で Arduino Hardware についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!