How to solve Vertcat error to PID graph?

1 次查看(过去 30 天)
I'm trying to run the following code but it sends an error, specifically:
Error using vertcat dimensions of matrices being concatenated are not consistent.
Error in Optimized_response (line 6)
T1 = TF ([25.2 * KD 21.2 * kd + 25.2 * KP 25.2 * ki + 21.2 * KP + 3 * kd 21.2 * ki + 3 * KP
Someone could help me fix it.
The code is:
clc
close all
kd=input('enter the value of kd');
kp=input('enter the value of kp');
ki=input('enter the value of ki');
T1=tf([25.2*kd 21.2*kd+25.2*kp 25.2*ki+21.2*kp+3*kd 21.2*ki+3*kp
3*ki],[1 16.58 25.41+25.2*kd 17.18+21.2*kd+25.2*kp 11.70+25.2*ki+21.2*kp+3*kd 21.2*ki+3*kp+1 3*ki]);
ltiview

回答(1 个)

Stephan
Stephan 2018-12-18
Hi,
try:
kd=input('enter the value of kd');
kp=input('enter the value of kp');
ki=input('enter the value of ki');
T1=tf([25.2*kd 21.2*kd+25.2*kp 25.2*ki+21.2*kp+3*kd 21.2*ki+3*kp+3*ki],...
[1 16.58 25.41+25.2*kd 17.18+21.2*kd+25.2*kp 11.70+25.2*ki+21.2*kp+3*kd 21.2*ki+3*kp+1 3*ki]);
ltiview
Best regards
Stephan

类别

Help CenterFile Exchange 中查找有关 Just for fun 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by