Error in port widths or dimensions. Invalid dimension has been specified for 'Input Port 1'

37 views (last 30 days)
When clicking on Run button I always get this error. For some reason a text "24{24}" appears close to the BusBar, and I get the following error:
Error in port widths or dimensions. 'Output Port 1' of 'MicrogridActivePowerControl/powergui/EquivalentModel1/Gates/From1' has 3 elements. This port does not accept the dimensions (or orientation) specified by the output signal.
Component:Simulink | Category:Model error
Error in port widths or dimensions. Invalid dimension has been specified for 'Input Port 1' of 'MicrogridActivePowerControl/powergui/EquivalentModel1/Gates/Mux'.
Can anyone tell me, how to find the issue rellated and fix it?

Accepted Answer

Nathan Hardenberg
Nathan Hardenberg on 22 Aug 2023
The error seems to be noticed in 'MicrogridActivePowerControl/powergui/EquivalentModel1/Gates/From1'. I'm guessing this is the "PWM"-From-Block to the right. A few steps beforehand you have a "PID(s)"-Block that seems to have an issue.
Note that the numbers on the arrows show the dimensions of the signal. Everyehere where there is a "?(dimension)", the compiler does not know the size of the signal. Since before the PID-controller the size is known and afterwards it isn't, the problem is most likely there. Maybe replace the block with a default PID and check if it works. Then change the block settings one at a time and check when it breaks. This assumes you changed anything in the PID-controller.
Second option: When looking at you diagram it seems that PWM should be of size [1x1] (the same as 1) since you only conntrol one gate. Note that your "RMS Measurement" outputs a vector of size [3x1] already. Maybe this is something you don't actually want. If you only want one of the three signals, use a selector block after the "RMS Measurement"
To the Mux Block error I can not say anything, since I do not know where the "-T-" comes from. It most likely assumes a 5-vector output which is can not do if the first input is of dimension 3 already. But maybe this fixes if you fix the other problem.

More Answers (0)


Find more on General Applications in Help Center and File Exchange




Community Treasure Hunt

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

Start Hunting!