Using fminbnd to find point closest to origin

1 次查看(过去 30 天)
So I have the parabola y = x^2 − 2x − 4
The distance to the origin is d(x) = sqrt(x^2 + (x^2 − 2x − 4)^2).
So I need to plot −2 ≤ x ≤ 4 for d(x), and use fminbnd to find the point closest to the origin, and then use fzero to find the point with a distance of 3 from the origin, but I don't know how to use either of these two commands. Could anyone possibly show me an example, or with this parabola show me how to do it? Thanks.

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Optimization 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by