Why does not this function fully set the dimensions of output port while simulating?

3 次查看(过去 30 天)
Hi everybody
I've been trying to simulated a planar five-bar parallel robot. The dynamic equations have been derived, modified and simplified by reduced model method.
The equations and inputs seems resonable, and I double checked the parameters and anything possible. but while simulating it, there is an annoying error below:
Error in default port dimensions function of S-function 'Dynamics_new_approach/MATLAB Function'. This function does not fully set the dimensions of output port 2
I'll apreciate it if anyone could help me with fixing this error.

回答(1 个)

Saurabh
Saurabh 2024-9-9
Hi Ramin,
It appears to be a MATLAB dimension mismatch, as the error indicates. I am providing a workaround here since I do not have access to the model:
  1. Open the MATLAB Function Block which reported the error and select Edit Data on the Editor tab. Alternatively select the block in the Model Explorer (CTRL+H).
  2. Select each variable corresponding to Input and Output ports, and in the Size edit box, specify the correct dimensions. The default is -1 or 'inherited', meaning automatically determined.
  3. Steps 1 and 2 may need to be repeated for other MATLAB Function Blocks in the model if they subsequently generate similar errors now.
See the following link for further information on the cause of this error:
I hope this was helpful

类别

Help CenterFile Exchange 中查找有关 Block Libraries 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by