How to put a variable in transfer function num and den?
조회 수: 13 (최근 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.
댓글 수: 0
답변 (1개)
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
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 Exchange에서 Calculus에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!