You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: assignToBins.m
    path of file: ./repos/MCITF/Code/MCITF/EdgeBox/piotr_toolbox/toolbox/images
    
    the code of the file until where you have to start completion: function B = assignToBins( A, edges )
% Quantizes A according to values in edges.
%

    
function B = assignToBins( A, edges )
% Quantizes A according to values in edges.
%
% assignToBins replaces each value in A with a value between [0,nBins] where
% nBins=length(edges)-1.  edges must be a vector of monotonically
% increasing values.  Each element v in A gets converted to a discrete
% value q such that edges(q)<=v< edges(q+1). If v==edges(end