Solve a matrix-form equation

4 ビュー (過去 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 Center および File ExchangeSymbolic Math Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by