wanna creat a matrix of unknowns and write some equations with those unknowns and then take the matrix of coefficients

조회 수: 1 (최근 30일)
I want to creat a matrix of unknowns like below
t(1,1) t(1,2)
t(2,1) t(2,2)
then i want to write some equations with this like
2*t(1,1) + 3*t(1,2)
then take the matrix of coefficients : a=[2 3]
I tried syms t(i,j) but it cant be done like this

답변 (2개)

David Hill
David Hill 2021년 1월 11일
syms a b c d;
t=[a b;c d];
coef=[2 3];
eqn=dot(coef,t(1,:));

Walter Roberson
Walter Roberson 2021년 1월 11일
t = sym('t%d_%d',[15,15]);
  댓글 수: 2
Aref Mirjalili
Aref Mirjalili 2021년 1월 12일
thanks but my next question is
i have a code like this:
for i=1:15
for j=1:15
t(i+1,j)+t(i,j+1)+t(i-1,j)+t(i,j-1)-4*t(i,j)
end
end
i want the matrix of coefficients of t
and it will be like this:

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

카테고리

Help CenterFile Exchange에서 Conversion Between Symbolic and Numeric에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by