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: idxtri2.m
    path of file: ./repos/jigsaw-matlab/tools/mesh_util
    
    the code of the file until where you have to start completion: function [tree] = idxtri2(vert,tria)
%IDXTRI2 create a spatial-indexing structure for a 2-simplex
%triangulation.
%   [TREE] = IDXTRI2(VERT,TRIA) returns an AABB-tree design-
%   ed to accelerate spatial queries into the triangulation
%   defined by {VERT,TRIA}. VERT is a V-by-D array of XY co-

    
function [tree] = idxtri2(vert,tria)
%IDXTRI2 create a spatial-indexing structure for a 2-simplex
%triangulation.
%   [TREE] = IDXTRI2(VERT,TRIA) returns an AABB-tree design-
%   ed to accelerate spatial queries into the triangulation
%   defined by {VERT,TRIA}. VERT is a V-by-D array of XY co-
%   ordinates and TRIA is a T-by-3 array of triangles. Each
%   row defines a triangle, such that VERT(TRIA(II,1),:),
%   VERT(TRIA(II,2),:) and VERT(TRIA(II,3),:) are the coord-
%   inates of the II-TH triangle.
%
%   See also MAKETREE

%   Darren Engwirda : 2017 --
%   Email           : d.engwirda@gmail.com
%   Last updated    : 10/07/2018

%---------------------------------------------- basic checks
    if ( ~isnumeric(vert) || ...
         ~isnumeric(tria) )
        error('idxtri2:incorrectInputClass' , ...
            'Incorrect input class.') ;
    end