How can I pick only first solution of equation

16 visualizzazioni (ultimi 30 giorni)
I made measurements and used them to plot x against y and found function that would describe the plot.
p1 = 258787.8788
p2 = -650125.2525
p3 = 577986.6667
p4 = -227435.083
p5 = 35645.6381
syms x
y = p1*x^4 + p2*x^3 + p3*x^2 + p4*x + p5 == pow
S = vpasolve (y,x)
I use variable 'pow' but lets say right now pow = 1430.
As a soultion I get 4 different values (as expected) but I only need the first one further on in the project. Its always the first one and values are too close to each other to put any assumptions which I tried.
Is there any way to make matlab ignore the three other solutions or anything that would give me similar results?
Thanks in advance for all the help :)

Risposta accettata

Walter Roberson
Walter Roberson il 5 Ago 2021
S(1)

You should also be considering

 roots([p1, p2, p3, p4, p5]) 

Più risposte (0)

Categorie

Scopri di più su Programming in Help Center e File Exchange

Prodotti


Release

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by