- When you run your MATLAB code before running the Simulink model, it sets up the necessary variables or configurations that the Simulink model relies on. However, if you make changes in Simulink without rerunning your MATLAB code, those dependencies might not be met, leading to errors. Better Approach: Use Simulink Callbacks for initializing data that is being used in the model.
- Blocks such as 'Gain' or 'Product' might be set to 'Matrix Multiplication' instead of 'Element-wise Multiplication' causing a mismatch in size.
Error in port widths or dimensions.
1 回表示 (過去 30 日間)
古いコメントを表示
I run my code in Matlab and my circuit in Simulink shows this error:
How can I solve that?
** I would like to add that whenever I run my code in Matlab and then I run Simulink my circuit works right. But whenever I make a change in Simulink (for example change a manual switch) and I don't run my code in Matlab after that change, the error occurs.
0 件のコメント
回答 (1 件)
Brahmadev
2023 年 9 月 8 日
Hi,
I understand that you are using the 'From' and 'GoTo' block to manipulate input data in Simulink. Here are some possible causes for the errors:
You can refer to the following MathWorks documentation for Model Callback functions:
Hope it 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!