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: idx_to_points.m
    path of file: ./repos/quadrotor/traj_planning/path_planning
    
    the code of the file until where you have to start completion: function xyz = idx_to_points(map, ijk)
% convert indices in occupancy grid into 3d points xyz (Nx3) 

    
function xyz = idx_to_points(map, ijk)
% convert indices in occupancy grid into 3d points xyz (Nx3) 
% @author: Yiren Lu
% @date: 02/15/2017
% @input:   map         map generated by load_map
%           ijk         Nx3 indices in map's occupancy grid
% @output:  xyz         Nx3 3d points in actual space
xyz = ones(size(ijk, 1), 3);
if size(ijk,1) > 0
xyz(:,1) = map.boundary(1)+(ijk(:,1)-1)*map.xy_res + map.xy_res*0.5;
xyz(:,2) = map.boundary(2)+(ijk(:,2)-1)*map.xy_res + map.xy_res*0.5;
xyz(:,3) = map.boundary(3)+(ijk(:,3)-1)*map.z_res + map.z_res*0.5;
else
xyz = [];
end