I have a problem of comparing two arrays on Matlab scripting and below I have explained.
%Array1 has one column
%Array2 has two columns
I want to compare each value of the single column in Array1 with the values in column 1 of Array2. If the value of Array1 matches or fits within a range or within a given limit range with a value in column1 of Array2, I wish to create a new array (Array3) with the corresponding value in Column2 of Array2.
Example: 1st value in column1 of Array1 = 1.61046126078761 Since this value is closest to 3rd value of column1 in Array2, I want to assign the first value in Array3 as 400. Likewise I want to check all the values in Array1 and assign the values and create the new Array3
Would be great if someone could help me out! Thanks in advance!
Best wishes Sarala