I need to build a quick one-to-one mapping between two large arrays of integers in Matlab. The mapping should take as an input element from a predefined array, for example:
in_range = [-200 2 56 45 ... ];
and match it by its index in the previous array with the corresponding element from another predefined array, for example:
out_range = [-10000 0 97 600 ... ];
For example, in the above case, it my_map(-200)should output -10000, but it my_map(45)should output 600.
I need a solution that
- You can match very large arrays (~ 100 thousand elements) relatively efficiently.
- Scales well with borders
in_rangeand out_range(i.e., values ββof minand max)
So far I have solved this problem using the Matlab frontend for Java with Java HashMaps , but I was wondering if there is an alternative to Matlab.
Thank!
source
share