# I am trying to find the integral gain (ki) of the following transfer function.

조회 수: 8(최근 30일)
Cathy Pakrath 2022년 5월 17일
답변: Star Strider 2022년 5월 17일
This is my code,
syms ki
sys = tf([30.672 175.694*ki],[1 38.672 175.694*ki]);
S = stepinfo(sys);
subplot(2,1,1)
step(sys)
However it's showing the error:
Error using tf (line 303)
The values of the "Numerator" and "Denominator" 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.

댓글을 달려면 로그인하십시오.

### 답변(2개)

VBBV 2022년 5월 17일
편집: VBBV 2022년 5월 17일
syms ki
ki = 10 % e.g numeric values , not symbolic
ki = 10
sys = tf([30.672 175.694*ki],[1 38.672 175.694*ki]);
S = stepinfo(sys);
subplot(2,1,1)
step(sys)
As the error states num and den vectors should be numeric, and not symbolic as you defined.
##### 댓글 수: 0표시숨기기 이전 댓글 수: -1

댓글을 달려면 로그인하십시오.

Star Strider 2022년 5월 17일
Symbolic variables are not permitted in Control System Toolbox objects, however anonymous functions are.
Try this —
sys = @(ki) tf([30.672 175.694*ki],[1 38.672 175.694*ki]);
ki = 42;
S = stepinfo(sys(ki))
S = struct with fields:
RiseTime: 0.0130 TransientTime: 0.1931 SettlingTime: 0.1931 SettlingMin: 0.7501 SettlingMax: 1.5173 Overshoot: 51.7266 Undershoot: 0 Peak: 1.5173 PeakTime: 0.0333
subplot(2,1,1)
step(sys(ki))
The value of ‘ki’ can be whatever you want, and you can use ‘sys’ here as an anonymous function as an argument to integration and optimisation functions.
.

댓글을 달려면 로그인하십시오.

R2021b

### Community Treasure Hunt

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

Start Hunting!

Translated by