- Controller inputs match plant outputs (both 3)
- Controller outputs match plant inputs (both 2)
how to use a feedback command when i have a matrix input
1 view (last 30 days)
Show older comments
my process model is 3*2 matrix and my controller is in 2*3 how to use feedback for this
0 Comments
Answers (1)
AR
on 16 Jun 2025
Given a process model P(s) with size 3×2 (3 outputs, 2 inputs) and a controller K(s) with size 2×3 (2 outputs, 3 inputs), the negative feedback interconnection is valid since:
In MATLAB, you can use the “feedback” function directly as shown below:
T = feedback(P, K);
This returns the closed-loop transfer function from external inputs to plant outputs, resulting in a system of size 3×2.
Here is an example for the “feedback” function:
% Define Laplace variable
s = tf('s');
% Define 3x2 plant P (3 outputs, 2 inputs)
P = [1/(s+1), 2/(s+2);
3/(s+3), 4/(s+4);
5/(s+5), 6/(s+6)];
% Define 2x3 controller K (2 outputs, 3 inputs)
K = [1/(s+7), 2/(s+8), 3/(s+9);
4/(s+10), 5/(s+11), 6/(s+12)];
% Check dimensions
disp('Size of P (plant):'); disp(size(P)) % Should be [3 2]
disp('Size of K (controller):'); disp(size(K)) % Should be [2 3]
% Form closed-loop negative feedback system
T = feedback(P, K);
% Display size of closed-loop system
disp('Size of closed-loop system T:');
disp(size(T)) % Should be [3 2] because feedback assumes the external input comes before the plant input (which is 2-dimensional).
% Simulate step response
figure;
step(T)
title('Step Response of Closed-Loop System T');
xlabel('Time (seconds)');
ylabel('Output');
You can use feedback(P, K, +1) for positive feedback if needed.
For more information on the “feedback” function, please refer to the documentation:
The documentation also includes an example on negative feedback for MIMO systems, which can be accessed in MATLAB by running:
openExample('control/NegativeFeedbackLoopWithMIMOSystemsExample')
I hope you find this helpful.
0 Comments
See Also
Categories
Find more on Dynamic System Models 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!