How to put a variable in transfer function num and den?

9 ビュー (過去 30 日間)
Mohammad Alzoubi
Mohammad Alzoubi 2021 年 3 月 29 日
コメント済み: Star Strider 2021 年 3 月 30 日
when i include a symbolic variable in a numenator of transfer function
clear all;clc;
syms k;
n1=[k]; d1=[1 10]; G=tf(n1,d1);
I get this==> The values of the "num" and "den" properties must be row vectors
or cell arrays of row vectors, where each vector is nonempty and
containing numeric data. Type "help tf.num" or "help tf.den" for
more information.

回答 (1 件)

Star Strider
Star Strider 2021 年 3 月 29 日
You are mixing Control System Toolbox and Symbolic Math Toolbox funcitons and syntax.
You cannot do that!
Try this instead:
n1=@(k)k;
d1=[1 10];
G=@(k)tf(n1(k),d1);
Note that it will be necessary to supply a numeric value for ‘k’ to use this, for example:
figure
bode(G(5))
.
  2 件のコメント
Mohammad Alzoubi
Mohammad Alzoubi 2021 年 3 月 29 日
編集済み: Mohammad Alzoubi 2021 年 3 月 29 日
I can not run this code and include k in The tf?
clear;clc; syms s t k;
%the TF=k/(s^2+4*s+3+k) R=1/s; num=@(k) [k]; den=@(k)[1 4 3+k]; TF=tf(num,den); ys=TF*R; sys=s*ys; yss=limit(sys,s,0); E=R-TF; sE=s*E; ess=limit(sE,s,0); yt=ilaplace(ys);
Star Strider
Star Strider 2021 年 3 月 30 日
Do not use the Symbolic Math Toolbox for this.
Use the Control System Toolbox, and it will work correctly.

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

カテゴリ

Help Center および File ExchangeCalculus についてさらに検索

製品


リリース

R2015a

Community Treasure Hunt

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

Start Hunting!

Translated by