So, I have the following issue, that confuses me. I have simulink model to compare different controller (in Variant Subsystems). I use mainly MATLAB Function Blocks to implement those controllers. For one controller, however, simulink throws me an error message:
This is the only error message and it doesn't make sense to me. But the simulation completes normally, and all the values seem correct. I could also set breakpoints and check on the matrix dimensions:
I am wondering if anybody had same issue and what causes it? I could just ignore it, but this does not seem right for me. I would rather fix this.

댓글 수: 2

As a matter of form, I would avoid using
r_n = N_x(1)\r;
The \ is seldom used with scalar left operand, so most people will not understand the operation you are doing there, which is equivalent to
r_n = r ./ N_x(1);
Marko Marković
Marko Marković 2024년 8월 19일
편집: Marko Marković 2024년 8월 19일
Ah, I see. Thank you for the remark!!

댓글을 달려면 로그인하십시오.

 채택된 답변

halleyhit
halleyhit 2024년 8월 19일

0 개 추천

It seems Simulink can not determine the size of variables in MATLAB Function block. Please try to use "edit data" on top left, and set your intput and output variable size other than -1.

댓글 수: 3

Thank you very much!! This resolved the issue. Do you know what might be the root cause? I did not have such an issue ever and I heavily use Matlab Function Blocks.
halleyhit
halleyhit 2024년 8월 22일
With setting size to -1, sometimes MATLAB is able to detemine the size, but sometimes it can not. I have no idea on when the detemination works, but best practice is to set the value strongly.
I see, thank you! I'll stick then with best practices and just set the dimensions.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Simulink에 대해 자세히 알아보기

제품

태그

질문:

2024년 8월 17일

댓글:

2024년 9월 2일

Community Treasure Hunt

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

Start Hunting!

Translated by