%% Solve Sylvester Equation with 4-by-2 Output
% Create a 4-by-4 coefficient matrix, A, and 2-by-2 coefficient matrix, B.

A = [1 0 2 3; 4 1 0 2; 0 5 5 6; 1 7 9 0];
B = [0 -1; 1 0];

%
% Define C as a 4-by-2 matrix to match the corresponding sizes of A and B.

C = [1 0; 2 0; 0 3; 1 1]

%
% Use the sylvester function to solve the Sylvester equation for these values of A, B, and C.

X = sylvester(A,B,C)

% The result is a 4-by-2 matrix.
% Copyright 2012 The MathWorks, Inc.