solve command
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Dear all, i have problem with solve command, this is my program:
H=[1 2 3; 4 5 6; 7 8 9]
S=[11 22 33; 44 55 66 ;77 88 99]
syms e11 e12 e13 e21 e22 e23 e31 e32 e33
E=[e11 e12 e13;e21 e22 e23;e31 e32 e33]
HMES=H-E*S
DE=solve('HMES(1,1)','HMES(1,2)','HMES(1,3)','HMES(2,1)','HMES(2,2)','HMES(2,3)','HMES(3,1)','HMES(3,2)','HMES(3,3)')
EI(1,1)=DE.e11;
EI(1,2)=DE.e12;
EI(1,3)=DE.e13;
EI(2,1)=DE.e21;
EI(2,2)=DE.e22;
EI(2,3)=DE.e23;
EI(3,1)=DE.e11;
EI(3,2)=DE.e12;
EI(3,3)=DE.e13;
this is Error:
??? Error using ==> subsref
Reference to non-existent field 'e11'.
Error in ==> sym.subsref at 16
y = builtin('subsref',struct(x),a);
Error in ==> Un55555titled at 11
EI(1,1)=DE.e11;
????
0 comentarios
Respuestas (2)
Taniadi
el 3 de Mayo de 2012
Are you trying to solve a system of linear equations? I found difficulties in using solve. If you want to solve linear equations numerically (and using a number), why don't you try to solve using fsolve or using matrix operations? I think that is easier.
0 comentarios
Walter Roberson
el 3 de Mayo de 2012
Remove the quotes.
DE = solve(HMES(1,1), HMES(1,2), HMES(1,3), HMES(2,1), HMES(2,2), HMES(2,3), HMES(3,1), HMES(3,2), HMES(3,3));
0 comentarios
Ver también
Categorías
Más información sobre Ordinary Differential Equations en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!