from A 802.16d System (Comments on English) by Carlos Batlles
A WiMAX System Simulation

find_index(num,table)
function index = find_index(num,table)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%                                                                       %
%%       Name: find_index.m                                              %
%%                                                                       %
%%       Description: It receives a table and a number to look for in    %
%%        first column.                                                  %
%%                                                                       %
%%       Result: It gives back the corresponding value of the second     %
%%        column.                                                        %
%%                                                                       %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

dim = size(table);
num_col = dim(1);

for i=1:num_col
    if num==table(i,1);
        index = table(i,2);
        return
    end
end

Contact us at files@mathworks.com