How can i solve a system which contains matrices

조회 수: 1 (최근 30일)
IOANNIS STAVROU
IOANNIS STAVROU 2019년 11월 22일
답변: darova 2019년 11월 22일
5x + 3y + z = c1
x + y + z = c2
3x + y + 2z = c3
Is there any way to solve this system if c1,c2,c3 are 1 x n matrices with known numbers without using a for loop for each value of c1,c2,c3 ?

채택된 답변

darova
darova 2019년 11월 22일
Here is the best way i know:
A = [5 3 1
1 1 1
3 1 2];
B = [c1(:) c2(:) c3(:)]';
C = inv(A) * B;

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Dynamic System Models에 대해 자세히 알아보기

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by