필터 지우기
필터 지우기

Error in port widths or dimensions.

조회 수: 3 (최근 30일)
MAGDALINI EFTHYMIADOU
MAGDALINI EFTHYMIADOU 2022년 6월 12일
답변: Brahmadev 2023년 9월 8일
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.

답변 (1개)

Brahmadev
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:
  1. 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.
  2. Blocks such as 'Gain' or 'Product' might be set to 'Matrix Multiplication' instead of 'Element-wise Multiplication' causing a mismatch in size.
You can refer to the following MathWorks documentation for Model Callback functions:
Hope it helps!

카테고리

Help CenterFile Exchange에서 Simulink Functions에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by