Solving an equation for a variable

조회 수: 5 (최근 30일)
Raymond Elliott
Raymond Elliott 2021년 2월 22일
댓글: Walter Roberson 2021년 2월 23일
I am given the following equation,
fx =@(x) ((15*3)/(3*pi^4*70*5.29E-6))*(48*3^3*cos((pi*x)/(2*3))-(48*3^3)+(3*pi^3*3*x^2)-(pi^3*x^3));
If I wanted to find the value of x at say fx = 10, is there a shortcut to do so in MATLAB?

채택된 답변

Walter Roberson
Walter Roberson 2021년 2월 22일
The trick is to create a new function, such as fx10, that is fx(x)-10 and then do root finding (fzero, fsolve, vpasolve) on that new function.
  댓글 수: 5
Raymond Elliott
Raymond Elliott 2021년 2월 22일
One last question, how were you able to find that there were two roots that were close to zero? Did you plot the function to see or did you do it some other way?
Walter Roberson
Walter Roberson 2021년 2월 23일
The second input is a starting guess.
I used a negative starting guess and a modest positive starting guess. Afterwards I plotted to confirm.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by