function [ value ] = get_value_from_arrs( X,Y, x_var ) %GET_VALUE_FROM_ARRS Summary of this function goes here % Detailed explanation goes here len = size(X); for k = 1:1:len-1 if (x_var >= X(k)) && (x_var < X(k+1)) value = Y(k); end end end