I kept on getting error that says "Error in port widths or dimensions. 'Output Port 1' of 'simulink_​controller​/Sum2' is a [2x2] matrix."

조회 수: 7 (최근 30일)
How can I solve the mentioned error? I couldn't figure out as I am new to simulink.
Thank you.
  댓글 수: 3
Pramod Sapkota
Pramod Sapkota 2020년 5월 30일
This is my simulink model. I have code written in matlab for lqr controller with non zero set point. I have 2 states x1 and x2 but my output of interest is x2 only. I get two errors :
Error in port widths or dimensions. 'Output Port 1' of 'simulink_PNZSP_controller/Sum2' is a [2x2] matrix.
Component:Simulink | Category:Model error
Error in port widths or dimensions. Invalid dimension has been specified for 'Input Port 1' of 'simulink_PNZSP_controller/integrator'.

댓글을 달려면 로그인하십시오.

답변 (1개)

Walter Roberson
Walter Roberson 2020년 5월 30일
Pass the output of the Sum2 block through a Selector block https://www.mathworks.com/help/simulink/slref/selector.html
  댓글 수: 1
Pramod Sapkota
Pramod Sapkota 2020년 5월 31일
I tried using that block still, it shows the same error since the error is shown in the output port of sum block before output reaches the selector block.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Multicore Processor Targets에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by