필터 지우기
필터 지우기

solve command

조회 수: 1 (최근 30일)
mahdi
mahdi 2012년 5월 1일
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;
????

답변 (2개)

Taniadi
Taniadi 2012년 5월 3일
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.

Walter Roberson
Walter Roberson 2012년 5월 3일
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));

카테고리

Help CenterFile Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by