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: adjacency_matrix.m
    path of file: ./repos/gptoolbox/mesh
    
    the code of the file until where you have to start completion: function [A] = adjacency_matrix(E)
  % ADJACENCY_MATRIX Build sparse adjacency matrix from edge list or face list
  % 

    
function [A] = adjacency_matrix(E)
  % ADJACENCY_MATRIX Build sparse adjacency matrix from edge list or face list
  % 
  % [A] = adjacency_matrix(E)
  % [A] = adjacency_matrix(F)
  % [A] = adjacency_matrix(T)
  %
  % Inputs:
  %   E  #E by 2 edges list
  %   or 
  %   F  #F by 3 triangle list
  %   or 
  %   T  #F by 4 tet list
  % Outputs:
  %   A  #V by #V adjacency matrix (#V = max(E(:)))
  %    
  % See also: facet_adjacency_matrix
  %

  if size(E,2)>2
    F = E;
    E = edges(F);
  end