Finding a single root of x^(3.6)=75

조회 수: 1 (최근 30일)
Sarah Elena Aiko Johnson
Sarah Elena Aiko Johnson 2022년 10월 4일
댓글: Steven Lord 2022년 10월 4일
Hi, the question is to use MATLAB to determine the real root of x^3.6 = 75. I thought I could use the fzero code and wrote this code below but I keep getting an error and can't figure out why or if this is how I should approach this question.
fun = x^(3.6)-75;
x0=3;
z = fzero(fun,x0)
can anyone help?
  댓글 수: 3
James Tursa
James Tursa 2022년 10월 4일
FYI, when you post "... I keep getting an error ..." it is best to copy & paste the entire error message in your question so that we don't have to guess what the error is.
Sarah Elena Aiko Johnson
Sarah Elena Aiko Johnson 2022년 10월 4일
okay thank you! Im new to the forum.

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

답변 (1개)

James Tursa
James Tursa 2022년 10월 4일
편집: James Tursa 2022년 10월 4일
Make a function handle with the @ operator. E.g.,
fun = @(x) x^(3.6)-75;
x0=3;
z = fzero(fun,x0)
z = 3.3178
Check
z^3.6
ans = 75
Or you can raise both sides of original equation to (1/3.6) power to solve for x directly.
Or you can solve directly using log( ) function as Benjamin suggests. (Followed up by using the exp( ) function)
  댓글 수: 1
Steven Lord
Steven Lord 2022년 10월 4일
There are also the nthroot and realpow functions.
nthroot(75, 3.6)
ans = 3.3178
realpow(75, 1/3.6)
ans = 3.3178

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

카테고리

Help CenterFile Exchange에서 Numerical Integration and Differentiation에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by