I have a system of equations,
constant + C.x + D.y = P
where C
and D
are 25*4 matrices. x
and y
are 4*1 matrices and P
is a 25*1 matrix. How do I solve this system of equations in MATLAB?
I have a system of equations,
constant + C.x + D.y = P
where C
and D
are 25*4 matrices. x
and y
are 4*1 matrices and P
is a 25*1 matrix. How do I solve this system of equations in MATLAB?
You can write the equations as
[C D] * [x ;y ] = P - constant
where [C D]
is a horizontal concatenation of C
and D
( 25 * 8 matrix ).
[x;y]
is a vertical concatenation of x
and y
( 8*1 vector )
You can solve this in Matlab using backslash operator:
xy = [C D] \ ( P - constant );
x = xy(1:4);
y = xy(5:end);