Error regarding Input port when using SIMULINK

2 ビュー (過去 30 日間)
Sameema Tariq
Sameema Tariq 2020 年 8 月 24 日
回答済み: Shlok 2024 年 11 月 30 日
I have system which shows error in this way.
Error in port widths or dimensions. Output port 1 of 'SMC1/LQR_Controller/u' is a one dimensional vector with 3 elements.
Error in port widths or dimensions. Input port 1 of 'SMC1/LQR_Controller/MatrixB' is a one dimensional vector with 1 elements.
Although the MatrixB is receiving the same input as u 's output. Kindly guide me how do I resolve this error.
The image of system is given below:

回答 (1 件)

Shlok
Shlok 2024 年 11 月 30 日
Hi Sameema,
The above-mentioned error indicates a mismatch in the dimensions of the signal going into and out of the blocks in your Simulink model. In the following figure, it appears that Output port of 'u' produces a 3-element vector, whereas Input port of 'MatrixB' expects a 1-element vector (or scalar).
You can follow one of the following approaches to resolve the issue:
  • Check whether the “MatrixB” block is configured correctly by validating its expected input dimensions with the output of “u.” Refer to the following documentation to know more about debugging signal dimensions: https://www.mathworks.com/help/simulink/ug/determining-output-signal-dimensions.html
  • If the input to “u” is configurable, you can adjust the output to match the dimensions expected by “MatrixB”. This might involve changing the parameterization or gain settings at the upstream block feeding “u”.
  • If MatrixB needs only one element from the 3-element vector, use a Selector block to extract the specific element required.

カテゴリ

Help Center および File ExchangeEvent Functions についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by