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

1 visualización (últimos 30 días)
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

Respuestas (2)

David Hill
David Hill el 11 de En. de 2021
syms a b c d;
t=[a b;c d];
coef=[2 3];
eqn=dot(coef,t(1,:));

Walter Roberson
Walter Roberson el 11 de En. de 2021
t = sym('t%d_%d',[15,15]);
  2 comentarios
Aref Mirjalili
Aref Mirjalili el 12 de En. de 2021
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:

Iniciar sesión para comentar.

Community Treasure Hunt

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

Start Hunting!

Translated by