フィルターのクリア

How to write nonlinear equation with several variables to use with bisection?

1 回表示 (過去 30 日間)
John Doe
John Doe 2020 年 11 月 10 日
編集済み: Matt J 2020 年 11 月 11 日
I'm new to MATLAB so forgive me if this question already exists, I'm just not sure what to search for exactly.
Basically I have the following equation:
4ba^3 + c^3 - 3a*c^2 = 0
I thought I would need to write the following function:
function output = myFunction(a,b,c)
output = 4ba^3 + c^3 - 3a*c^2;
end
and then I could call the bisection method like so:
a = some value
b = some value
bisection(@myFunction,Xl,Xr,iterations,tolerance)
but I get an error not enough inout arguments, which I can only attribute to the lack of a specified c, which I thought the bisection would handle.
How do I correctly write the function so I can use it with bisection?

回答 (1 件)

Matt J
Matt J 2020 年 11 月 11 日
編集済み: Matt J 2020 年 11 月 11 日
a = some value
b = some value
bisection(@(X) myFunction(a,b,X),Xl,Xr,iterations,tolerance)

カテゴリ

Help Center および File ExchangeProgramming についてさらに検索

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by