Determining indices upon which a sequence of real numbers is convex

1 vue (au cours des 30 derniers jours)
Paul Fishback
Paul Fishback le 24 Juin 2014
Commenté : Paul Fishback le 25 Juin 2014
I have a vector, X, of real numbers which has a minimum at index k, where 1<k<n.
I want to determine the smallest index k1 and largest index k2, for which the sequence is strictly convex on k1,..,k,...k2. Here, convexity means 2X(i) < X(i-1)+X(i+1) for k1+1<=i<=k2-1.
In calculus terms, this question is analogous to determining the largest subinterval about a local minimum upon which the function's second derivative is positive.

Réponse acceptée

Roger Stafford
Roger Stafford le 25 Juin 2014
k1 = k+1-find(diff([x(k+1:-1:1),-inf],2)<=0,'first');
k2 = k-1+find(diff([x(k-1:n),-inf],2)<=0,'first');

Plus de réponses (0)

Catégories

En savoir plus sur Polynomials dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by