Clear Filters
Clear Filters

How to solve Vertcat error to PID graph?

1 view (last 30 days)
Fer Ruiz
Fer Ruiz on 18 Dec 2018
Answered: Stephan on 18 Dec 2018
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

Answers (1)

Stephan
Stephan on 18 Dec 2018
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

Categories

Find more on Just for fun in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!