Errors during my simulation
6 views (last 30 days)
Show older comments
Hello, I'm a french student in STI2D terminale, and I work on my final project with the software matlab simulink. Could someone help me solve the problem that appears on the attached screenshot, please.
Error in port widths or dimensions. Output port 1 of 'Charge_batterie_refuge/From Workspace' is a one dimensional vector with 8 elements. Component:Simulink | Category:Model error Error in port widths or dimensions. Input port 1 of 'Charge_batterie_refuge/Simulink-PS Converter' is a one dimensional vector with 1 elements. Thank you.
0 Comments
Answers (1)
Rajanya
on 15 Apr 2025
The error is because the 'Simulink-PS Converter' is expecting a scalar (size 1 vector) input signal but is getting a vector of 8 elements from the 'From Workspace' block at any given time step in the simulation.
The downstream block connected to the 'Simulink-PS Converter' must be requiring a single value (as its input) and since the signal size of the output and the input to the 'Simulink-PS Converter' are always the same (see here), it does not accept when the incoming signal dimension at the input port mismatches with that expected by the output port, causing the error.
If you still want to use the 'From Workspace' block with the same signal data here, a workaround could be to use a 'Selector' block so that the input signal to the 'Simulink-PS Converter' (here) is always of size 1 at every time step throughout the simulation.
To learn more about the functioning of the 'Simulink-PS Converter' and the 'Selector' blocks, you can refer to their respective documentation pages by executing the following commands from MATLAB Command Window -
doc Simulink-PS Converter
doc Selector
Thanks!
0 Comments
See Also
Categories
Find more on Introduction to Installation and Licensing in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!