Error in port widths or dimensions
2 ビュー (過去 30 日間)
古いコメントを表示
Hi everyone, I have a problem when running my simulink file. I have pid block and s-function block diagram in simulink file with the 11 outputs and 1 input. When I try to run this file I receive the following error for pid block:
Error in port widths or dimensions. Output port 1 of 'project1_simu/PID Controller' is a one dimensional vector with 11 elements
and the following error for s-function file:
Error in port widths or dimensions. Input port 1 of 'project1_simu/S-Function' is a one dimensional vector with 1 elements
How to solve this error?
0 件のコメント
採用された回答
Kaustubha Govind
2012 年 2 月 1 日
Apparently the S-function expects a scalar value, but you are feeding in a vector of length=11. If you've written the S-function, you need to use something like "ssSetInputPortWidth(S, 0, 11);" or "ssSetInputPortWidth(S, 0, DYNAMICALLY_SIZED);" in mdlInitializeSizes.
2 件のコメント
Kaustubha Govind
2012 年 2 月 13 日
The error clearly states the issue. The value you are returning for flag=1 needs to be a real vector of length=11. What are you returning in "sys"?
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Block and Blockset Authoring についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!