I have an N x M x P array. Its filled with all possible values of a parameter. I'm looking for the value closest to a target I have. I need to find that value and the index of said value.
I've played around with these functions but they don't work the way I want them.
[C, I] = min(min(min(abs(theta-targettheta))));
this only return the p index not the n or m
this isn't returning just 1 result or the array even.