'dare' command from Control toolbox doesn't work in the Simulink's 'Matlab Function' block

'dare' command can work in the script and the real-time script, but it can not work in the Simulink's 'matlab function' block;
I have checked the license of the 'Control_Toolbox', it returns to 'answer = 1'.
Error infos are:
'Function 'dare' not supported for code generation. '
'Function 'MATLAB Function' (#23.726.769), line 28, column 1: "[P,L,M]=dare(Tilde_A,Tilde_B,Tilde_Q,R,S,E)" Launch diagnostic report.'
Appreciate for any advice!

2 件のコメント

Walter Roberson
Walter Roberson 2022 年 9 月 6 日
Note that you should probably be using the / or \ operator instead of inv() with a matrix multiplication
Dongxiao
Dongxiao 2022 年 9 月 6 日
I will, thanks for your notice.

サインインしてコメントする。

回答 (1 件)

Paul
Paul 2022 年 9 月 6 日

0 投票

In the Matlab Function block, declare dare with coder.extrinsic. See this doc page

2 件のコメント

Walter Roberson
Walter Roberson 2022 年 9 月 6 日
This will not solve the problem if Rapid Accelerator is turned on, or if code is being generated such as for deploying to arduino. In those cases the solution is to write your own equivalent to dare()
Dongxiao
Dongxiao 2022 年 9 月 6 日
My first thought is also writing a direct riccati_solver, I do this just for simulation. So I may try coder.extrinsic as well.
Thank you Paul and Watler!

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeSimulink Coder についてさらに検索

質問済み:

2022 年 9 月 6 日

コメント済み:

2022 年 9 月 6 日

Community Treasure Hunt

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

Start Hunting!

Translated by