看板 MATLAB 關於我們 聯絡資訊
小弟我在simulink中matlab function中打了以下程式碼 輸入u為一個數字 輸出Kopt為矩陣 程式碼如下 function Kopt = fcn(u) A =[-0.2331 0.1635 0 0 0.0075 0; 0.1635 -0.1710 0 0 0 0.0075; 0 0 -0.2257 0.1635 0 0; 0 0 0.1013 -0.1013 0 0; 0.0001 0 0 0 -0.0041 0; 0 0.0001 0 0 0 -0.0041;] B =1000*[ -0.7884 -2.3757 0; -0.0053 -0.0053 0; 0.0000 -0.0000 0.0001; 0.0000 0.0000 0; 0.0010 0.0010 0; 0.0010 0.0010 0;] Ropt=[1.8e8 0 0; 0 1.8e8 0; 0 0 1.8e8;] Qopt=[u 0 0 0 0 0; 0 1 0 0 0 0; 0 0 1 0 0 0; 0 0 0 1 0 0; 0 0 0 0 0 0; 0 0 0 0 0 0;] Kopt=lqr(A,B,Qopt,Ropt) 可是系統都會顯示 The function 'lqr' is not supported for standalone code generation. See the documentation for coder.extrinsic to learn how you can use this function in simulation. 是在simulink function中 lqr指令不能用嗎 因為小弟把這段程式碼打在一般m file中可以執行 是哪裡有問題呢 小弟願以1000P幣答謝 感謝大家了 -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 140.116.155.120 ※ 文章網址: https://www.ptt.cc/bbs/MATLAB/M.1441018671.A.450.html
yihow: 我也想知道... 09/01 16:52
weinottm: Iqr 要有安裝對應的toolbox才能用 那訊息就是沒裝 09/03 06:08
樓上可是我在一般的M FILE打lqr可以執行欸 是因為simulink內的embedded matlab function可執行的東西跟一般m file不一樣嗎? ※ 編輯: manflavor (140.116.155.120), 09/03/2015 13:48:32