필터 지우기
필터 지우기

Simulink upper bound is not specified

조회 수: 4 (최근 30일)
ozan eren
ozan eren 2020년 5월 11일
Hi,
I am trying to built a Matlab function in Simulink. The function code is provided below, but I keep getting this error: "Output 'Q' has variable size but the upper bound is not specified; explicit upper bound must be provided." I read that it is related with Simulation target and Dynamic memory allocation in Matlab is checked. Also, I checked the variable size in edit data window and set type as double.
I could not figured out what might be problem and how to solve it. Any help will be appreciated, thanks in advance.
function [Q, H] = deneme_roots(C1,C2,C3,C4,C5,C6)
r = roots([C5 (-C1+2*C4-C6) (3*C2-3*C5) (C1-2*C3+C6) -C2]);
r = r(r==conj(r)); % discard complex-conjugate roots
Jr = ((1./(r.^2+1).^2).*(r.^4*C4-2*C5*r.^3+(C1+C6)*r.^2-2*C2*r+C3))';
J = Jr;
Q = r(Jr==J); % keep Q that minimizes cost function
H = (2/(Q^2+1)^4)*(-2*C5*Q^5+(3*C1-6*C4+3*C6)*Q^4+(-12*C2+16*C5)*Q^3 ...
+(-8*C1+10*C3+6*C4-8*C6)*Q^2+(12*C2-6*C5)*Q+(C1-2*C3+C6));

답변 (0개)

카테고리

Help CenterFile Exchange에서 General Applications에 대해 자세히 알아보기

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by