Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Trying to Implement a Function in Simulink

조회 수: 1 (최근 30일)
Ashish Yadav
Ashish Yadav 2018년 7월 30일
마감: MATLAB Answer Bot 2021년 8월 20일
Hi, I am trying to implement a function inside the Simulink model and it gives me the following errors. "Computed Maximum size is not bounded" for parameters that r used inside the function. If I run the function as it is from the command window then it gives me 0 errors. The input to the function is (double[4x1], double[1x1], double[1x1] ) and the output is a profile whose length is decided inside the function.
I am attaching a view with the diagnostic viewer and with Matlab coder app.
Thanks.
Cheers!! Ash

답변 (1개)

Denis Gurchenkov
Denis Gurchenkov 2018년 7월 31일
The version of MATLAB Coder that you have supports generating code for matrices of unbounded size (it generates C code that calls malloc/free to allocate memory for those matrices). Your version of Simulink does not have that feature -- it wants all matrices to have a known upper bound.
You can either upgrade to a newer release (as of now, currently shipping release of Simulink does not have that limitation), or add hint in the code, helping Simulink to know what is the biggest size of that matrix.
the bottom line: add
assert(len < 1000);
before the zeros(len, 1)
and that should help.

이 질문은 마감되었습니다.

제품


릴리스

R2015b

Community Treasure Hunt

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

Start Hunting!

Translated by