Simulink Dimension Mismatch Error

조회 수: 16 (최근 30일)
Bahaa Soliman
Bahaa Soliman 2021년 10월 23일
답변: Salman Ahmed 2021년 11월 18일
I am attempting to run a Simulink File for a 5x5 Matrix to design a Controller. The file works perfectly fine for 4*x matrices, but it struggles to perform anything for 5*x, and it gives me an error regarding a dimension mismatch. I will attach a screenshot of the problem below (the MATLAB Code Surrounding this Question works fine). The problem mainly lies in the 'F*u' Op-Amp, and the Mux '2':

답변 (1개)

Salman Ahmed
Salman Ahmed 2021년 11월 18일
Hi Bahaa,
From my understanding this error has originated as you are trying to multiply the output of the mux which is a signal of dimension [1x2] with F having the dimension [5x1]. As a general rule for matrix multiplication the number of columns of the first matrix must be equal to the rows of the second. So, in this case, you could modify the number of outputs to be 5 for the mux or the number of rows of F to be 2 to satisfy this condition. Hope this resolves your issue.


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




Community Treasure Hunt

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

Start Hunting!

Translated by