Date: Jun 16, 2013 3:34 AM Author: Bruno Luong Subject: Re: match matrix to closest values "Y " <email@example.com> wrote in message <firstname.lastname@example.org>...
> That's a good way to use interp1 I wasn't aware of, thanks.
> Do you have a suggestion on how to get back the indices back from interp1? Or is the best one find(ismember(h,val))?
Simply do this:
idx = interp1(h,1:length(h),needle,'nearest')