我有一个方程组,
constant + C.x + D.y = P
其中C
和D
是 25*4 矩阵。x
和y
是 4*1 矩阵并且P
是 25*1 矩阵。如何在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);