Finding a single root of x^(3.6)=75
3 ビュー (過去 30 日間)
古いコメントを表示
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
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.
回答 (1 件)
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)
Check
z^3.6
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
2022 年 10 月 4 日
参考
カテゴリ
Help Center および File Exchange で Exponents and Logarithms についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!