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: isPAACentroidValid.m
    path of file: ./repos/qd-realization/src/raytracer
    
    the code of the file until where you have to start completion: function check = isPAACentroidValid(roomCoordinates, centroidCoordinate)
%ISPAACENTROIDVALID returns check if the centroid inside the defined area (box).
%
%   ISPAACENTROIDVALID(roomCoordinates, centroidCoordinate)
%   Generate a warning is the centroid coordinates centroidCoordinate are
%   outside the area defined in roomCoordinates
%

    
function check = isPAACentroidValid(roomCoordinates, centroidCoordinate)
%ISPAACENTROIDVALID returns check if the centroid inside the defined area (box).
%
%   ISPAACENTROIDVALID(roomCoordinates, centroidCoordinate)
%   Generate a warning is the centroid coordinates centroidCoordinate are
%   outside the area defined in roomCoordinates
%
%   check = ISPAACENTROIDVALID(roomCoordinates, centroidCoordinate)
%   Return false if the centroid coordinates centroidCoordinate are
%   outside the area defined in roomCoordinates
%
%   Copyright 2019-2020 NIST/CTL (steve.blandino@nist.gov)

%#codegen

roomCoordinates = reshape(permute(reshape(roomCoordinates,size(roomCoordinates,1),3,[]),[1,3,2]),[],3);
minCoord = min(roomCoordinates);
maxCoord = max(roomCoordinates);


if ~all(reshape(centroidCoordinate>= minCoord & centroidCoordinate<= maxCoord, [],1))
    warning OFF BACKTRACE
    warning('PAA outside defined area')
    warning ON BACKTRACE
    check = false;
else
    check = true;
end