The 'sdpvar' class does not support code generation.

조회 수: 8 (최근 30일)
Jianhui Zhi
Jianhui Zhi 2017년 10월 14일
댓글: Jianhui Zhi 2017년 10월 19일
This problem occurs during the usage of Yalmip R20150204 toolbox in either 'S-function' or 'MATLAB Function' of Simulink. The input variables are Ru, W_est,and v. The output variables are s and u. The code is shown as follows(Matlab version R2014a). How can I make the Yalmip R20150204 toolbox work in Simulink module,either 'S-function' or 'MATLAB Function'? Bv = 1; B = [1 1 1]; n = size(B,1); m = size(B,2); s = sdpvar(n,1); u = sdpvar(m,1); Q = eye(n); % constraints F1=[B*W_est*u==Bv*v+s]; F2=[F1, u<=5*ones(m,1), u>=-5*ones(m,1)]; solvesdp(F2, 10^5*s'*Q*s+u'*Ru*u); s= double(s); u= double(u);

채택된 답변

Johan Löfberg
Johan Löfberg 2017년 10월 18일
https://yalmip.github.io/example/simulink/
  댓글 수: 1
Jianhui Zhi
Jianhui Zhi 2017년 10월 19일
Thank you so much for this wonderful answer in such a detail. The problem is finally well-addressed.
Thank you again and best wishes.

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

추가 답변 (0개)

카테고리

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

제품

Community Treasure Hunt

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

Start Hunting!