I have a 100 x 1 vector with numeric values, what I want to find is the minimum combination of the reference point with the upper and lower indices for the equation below. For example:
comb = +-A(31 + 1) +- A(31) +- A(31-1)
I want to find the absolute minimum combintation of all the possible combinations. Can a function be created to perform this operation since I need to perform this for multiple vectors in a for loop?
I'd appreciate it if someone can please help me, thank you!