Retreiving equations from a matrix
Mostrar comentarios más antiguos
I have a symbolic matrix that has equation in it.
I want to extract the equations.
I have the code from the inside nodes.
B =
[50, 100, 100, 200]
[50, T23 - 4*T22 + T32 + 150, T22 - 4*T23 + T33 + 300, 200]
[50, T22 - 4*T32 + T33 + 350, T23 + T32 - 4*T33 + 500, 200]
[50, 300, 300, 200]
for i=2:n;
for j=2:m;
eq(i,j)=B(i,j)
end
end
But this doesnt work
I would like my answer to be
eq(2,2)=B(2,2)
eq(2,3)=B(2,3)
4 comentarios
Snicklefrits
el 2 de Nov. de 2021
Snicklefrits
el 2 de Nov. de 2021
Snicklefrits
el 2 de Nov. de 2021
Respuesta aceptada
Más respuestas (1)
Sulaymon Eshkabilov
el 2 de Nov. de 2021
Here is the corrected code:
clearvars
syms T22 T32 T33 T23
%% Note how your equations are set up
B =[50, 100, 100, 200;
50, T23 - 4*T22 + T32 + 150, T22 - 4*T23 + T33 + 300, 200;
50, T22 - 4*T32 + T33 + 350, T23 + T32 - 4*T33 + 500, 200;
50, 300, 300, 200];
for ii = 1:4
for jj=1:4
EQN(ii,jj)=B(ii,jj)
end
end
% Test
EQN(2,2)
EQN(3,2)
1 comentario
Snicklefrits
el 2 de Nov. de 2021
Categorías
Más información sobre Financial Toolbox en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
