Solve a matrix-form equation

조회 수: 2 (최근 30일)
Homayoon
Homayoon 2015년 6월 26일
댓글: Homayoon 2015년 6월 26일
Dear All,
I have a matrix of constants that gives me the constants for my equation. I need to know how to solve that equation in MATLAB. Assume the following is my matrix of constants :
Constants= [ 0.05888460 1.325 1
-0.06136111 1.87 1
-0.002650473 2.5 2
0.002731125 2.8 2
0.001802374 2.938 2.42
-0.001150707 3.14 2.63
0.00009588528 3.37 3
-0.000000110904 3.75 4
0.0000000001264403 4 5];
and the equation comes from the following sum:
Sum=1;
for i=1:9
Sum= Sum + (Constants(i,1) * ((100/333)^( Constants(i,2))) * ((x)^(Constants(i,3))));
end
basically the equation I want to solve is :
eqn = Sum == 1.0259;
solx = solve(eqn, x)
I do not know why I could not use
syms x
command to define an equation! Please help, I appreciate your attention! Best

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2015년 6월 26일
s=sum(Constants(:,1) .* (100/333).^Constants(:,2) .* x.^Constants(:,3) )
sol=solve(s)
  댓글 수: 2
Homayoon
Homayoon 2015년 6월 26일
it gives me an error! undefined variable x!
Homayoon
Homayoon 2015년 6월 26일
i fix it! thanks

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by