Date: Jun 16, 2013 3:34 AM Author: Bruno Luong Subject: Re: match matrix to closest values "Y " <firstname.lastname@example.org> wrote in message <email@example.com>...
> 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')