请问m函数中能否构建传递函数

求教,m函数中能够构建传递函数
function y = fcn(u)
%#codegen
num=[1 0];
den=[1 2 1];
sys=tf(num,den);
y = sys*u;
报错如下
The 'tf' class does not support code generation.

Function 'MATLAB Function' (#38.58.69), line 5, column 5:
"tf(num,den)"
Launch diagnostic report.
Component: MATLAB Function | Category: Coder error

2 件のコメント

hao
hao 2023 年 3 月 29 日
are you ok?
hao
hao 2023 年 3 月 29 日
are you ok?

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

回答 (1 件)

hao
hao 2023 年 3 月 28 日

0 投票

传递函数使用传递函数块,不要用matlab function

カテゴリ

ヘルプ センター および File ExchangeLoops and Conditional Statements についてさらに検索

コメント済み:

hao
2023 年 3 月 29 日

Community Treasure Hunt

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

Start Hunting!

Translated by