I would like to know if there exists a function in MATLAB that is equivalent to the VLOOKUP function in Excel.
I have created the following matrix in MATLAB:
mydata=[datenum('1/31/2008') 3; datenum('2/28/2008') 5];
I would like to search for a lookup_value in the first column of an array. If there exists a value in the first column of an array that is matching the lookup_value (exact match), then the function should return a value in the same row from another column in the array. If an exact match does not exists, the function should return the next largest value that is less than lookup_value.
For example, for the matrix above,
myMatch= fcm(mydata,datenum('2/7/2008'))
should output
myData= 3
Best Answer