필터 지우기
필터 지우기

Solving a system of equations

조회 수: 3 (최근 30일)
Mitra Taghizadeh
Mitra Taghizadeh 2022년 8월 9일
답변: Paul 2022년 8월 10일
Hello everyone.
I have a system of equations in matrix form like this: (This is just an example. In fact the size of matrix A is 13*1 and B is 13*53 and C is 53*13]).
A=B*C
A=[x1,y1,z1,0,0,0,1]'
B=[a1,a2,a3,0,0,0,a4;a5,a6,a7,0,0,0,0;a8,a9,a10,0,0,0,0;0,0,0,a11,a12,0,a13;0,0,0,a14,a15,0,a16;0,0,0,a17,a18,a19,a20;0,0,0,0,0,0,1];
C=[3,4,5,x2,y2,z2,1]'
In this equation x1,x2,y1,y2,z1,z2 are the unknowns and ai (i=1 to 20) are the known values.
Do you know how can I solve this system?
  댓글 수: 2
Paul
Paul 2022년 8월 9일
Hi Mitra
Please update the example. B has 6 rows; it should have seven.
Mitra Taghizadeh
Mitra Taghizadeh 2022년 8월 10일
Hi
Yes thank you.

댓글을 달려면 로그인하십시오.

답변 (1개)

Paul
Paul 2022년 8월 10일
Hi Mitra
Maybe this will extend to the larger problem.
syms x1 y1 z1 x2 y2 z2
syms a [1 20]
A=[x1,y1,z1,0,0,0,1].';
B=[a1,a2,a3,0,0,0,a4;a5,a6,a7,0,0,0,0;a8,a9,a10,0,0,0,0;0,0,0,a11,a12,0,a13;0,0,0,a14,a15,0,a16;0,0,0,a17,a18,a19,a20;0,0,0,0,0,0,1];
C=[3,4,5,x2,y2,z2,1].';
sol = solve(A==B*C,[x1 y1 z1 x2 y2 z2])
sol = struct with fields:
x1: 3*a1 + 4*a2 + 5*a3 + a4 y1: 3*a5 + 4*a6 + 5*a7 z1: 3*a8 + 4*a9 + 5*a10 x2: (a12*a16 - a13*a15)/(a11*a15 - a12*a14) y2: -(a11*a16 - a13*a14)/(a11*a15 - a12*a14) z2: (a11*a16*a18 - a12*a16*a17 - a13*a14*a18 + a13*a15*a17 - a11*a15*a20 + a12*a14*a20)/(a19*(a11*a15 - a12*a14))

카테고리

Help CenterFile Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by