Filter löschen
Filter löschen

Solve a matrix-form equation

1 Ansicht (letzte 30 Tage)
Homayoon
Homayoon am 26 Jun. 2015
Kommentiert: Homayoon am 26 Jun. 2015
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

Akzeptierte Antwort

Azzi Abdelmalek
Azzi Abdelmalek am 26 Jun. 2015
s=sum(Constants(:,1) .* (100/333).^Constants(:,2) .* x.^Constants(:,3) )
sol=solve(s)
  2 Kommentare
Homayoon
Homayoon am 26 Jun. 2015
it gives me an error! undefined variable x!
Homayoon
Homayoon am 26 Jun. 2015
i fix it! thanks

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by