필터 지우기
필터 지우기

How can I pick only first solution of equation

조회 수: 6 (최근 30일)
Dominika Krason
Dominika Krason 2021년 8월 5일
답변: Walter Roberson 2021년 8월 5일
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 :)

채택된 답변

Walter Roberson
Walter Roberson 2021년 8월 5일
S(1)

You should also be considering

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Programming에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by