Is there any MATLAB toolbox that can find the local MAX of a piece-wise multi-variable function?
Show older comments
I have a piece-wise function f(x,y,z) which is not linear necessarily. Is there any toolbox that can find the local maximums of this function in MATLAB?
Thanks
Answers (2)
Gouri Chennuru
on 25 Sep 2020
1 vote
Hi Niloufar,
You can use “islocalmin” function in order to find the local minima which returns a logical array whose elements are 1 (true) when a local minimum is detected in the corresponding element of an array, table, or timetable.
Similarly you can make use of “islocalmax” function in order to find the local maxima which returns a logical array whose elements are 1 (true) when a local maximum is detected in the corresponding element of an array, table, or timetable.
You can also use “findpeaks” returns a vector with the local maxima (peaks) of the input signal vector, data which is available in the signal processing toolbox.
Hope this Helps!
2 Comments
Niloufar Mirzavand Boroujeni
on 1 Oct 2020
Walter Roberson
on 1 Oct 2020
islocalmin() would be for vectors, not for functions.
Bruno Luong
on 25 Sep 2020
1 vote
fmincon and friends if you have the toolbox.
3 Comments
Niloufar Mirzavand Boroujeni
on 1 Oct 2020
Walter Roberson
on 1 Oct 2020
fmincon cannot handle discontinuities over the range it is testing.
You can, though, test one range at a time, if the boundaries of the ranges can reasonably be determined.
Bruno Luong
on 1 Oct 2020
Piecewise function is not necessary discontinue, e.g., a spline.
Categories
Find more on Data Preprocessing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!