Clear Filters
Clear Filters

Fast Look-up table

3 views (last 30 days)
T on 26 Feb 2015
Answered: dpb on 26 Feb 2015
Good morning, I have a long array signal with values x. Now for each of those values x I want to find the closest fit in another array pvalues and return the index. At the moment I am doing it like this:
for a=1:1:length(signal)
[c index1] = min(abs(tempp));
%do stuff with index1
But this takes a lot of time (hours)! If I comment all lines and only iterate through the array signal, it is done in 3 seconds. So the problem is finding the index1 value.
Any ideas how to solve this quickly?
Thank you!

Answers (1)

dpb on 26 Feb 2015


Find more on Creating and Concatenating Matrices in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!