Local minima of an interpolant fit

2 ビュー (過去 30 日間)
Sh_
Sh_ 2022 年 6 月 21 日
編集済み: Torsten 2022 年 6 月 21 日
Hello, I have a 2d interpolant fit (linear, but any interpolant type will do) for a scatter plot, for which i need to locate the local minimas, meaning multiple minimas. How would one proceed to do that?
Using islocalmin on the plot the fit is fitted on, results in too many false positives.
I was thinking to contruct a function made up of all the coefficients the fit uses to construct the piecewise like fit, but i'm not sure how to do so.

回答 (1 件)

Torsten
Torsten 2022 年 6 月 21 日
編集済み: Torsten 2022 年 6 月 21 日
Pass the evaluating function for the interpolant as objective function to fminsearch or another optimizer (fmincon,...).
E.g.
x = 0:0.02:1;
f = (x-0.5).^2;
fun = @(u)interp1(x,f,u,'spline');
sol = fminsearch(fun,0.1)
sol = 0.5000
  4 件のコメント
Sh_
Sh_ 2022 年 6 月 21 日
I need the process to be automated, such that I dont really need to look at the graph.
Torsten
Torsten 2022 年 6 月 21 日
編集済み: Torsten 2022 年 6 月 21 日
Ok, if you don't want to invest that effort, you will have to stick to the "old" solution.
Or you try "MultiStart" for the optimizer.

サインインしてコメントする。

カテゴリ

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

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by