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: build_icosa.m
    path of file: ./repos/HRTF-Individualization/model/matlabcode/functions/library/icosahedron
    
    the code of the file until where you have to start completion: function [x2, y2, z2]=build_icosa(x, y, z)
% % Syntax;
% % 
% % [x2, y2, z2]=build_icosa(x, y, z);
% % 
% % ***********************************************************
% % 
% % Description
% % 
% % Program makes a hemispherical icosahedron of f frequency of type 2 
% % If f is even a full hemisphere is output.  
% % If f is odd only a partial hemisphere is output. 
% % Odd frequency icosahedra do not have a hemispherical cutting plane.  
% % 
% % ***********************************************************
% % 
% % Input Variables
% %
% % x, y, z are vectors with the rectangular coordinates of the 
% %         master triangle fro an icosahedron.
% % 
% % ***********************************************************
% % 
% % Output Variables
% % 
% % x2, y2, z2 are vectors with the rectangular coordinates for the nodes a
% % of a hemispherical icosahedron. 
% % 
% % 
% % ***********************************************************
% % 
% Example
% 

    
function [x2, y2, z2]=build_icosa(x, y, z)
% % Syntax;
% % 
% % [x2, y2, z2]=build_icosa(x, y, z);
% % 
% % ***********************************************************
% % 
% % Description
% % 
% % Program makes a hemispherical icosahedron of f frequency of type 2 
% % If f is even a full hemisphere is output.  
% % If f is odd only a partial hemisphere is output. 
% % Odd frequency icosahedra do not have a hemispherical cutting plane.  
% % 
% % ***********************************************************
% % 
% % Input Variables
% %
% % x, y, z are vectors with the rectangular coordinates of the 
% %         master triangle fro an icosahedron.
% % 
% % ***********************************************************
% % 
% % Output Variables
% % 
% % x2, y2, z2 are vectors with the rectangular coordinates for the nodes a
% % of a hemispherical icosahedron. 
% % 
% % 
% % ***********************************************************
% % 
% Example
% 
% f=2;  % 2 frequency icosahedron.
% 
% r=4;  % 4 meter radius.
% 
% [x2, y2, z2, it]=icosahedron_nodes(f, r);
% 
% [x, y, z]=build_icosa(x2, y2, z2, sphere);
% 
% % ***********************************************************
% % 
% % List of Sub Programs
% % 
% % rotate_transform2
% % shift_theta
% % 
% % ***********************************************************
% % 
% % This program was written by Edward L. Zechmann 
% % 
% %     date     January 2007  
% % 
% % modified 11   March   2008  added examples
% % 
% % ***********************************************************
% % 
% % Feel free to modify this code.
% % 

nx=length(x);
radius=norm([x(1), y(1), z(1)]);

f=-3/2+sqrt(9/4+2*(length(x)-1));

% remove the right edge
% nre--> no right edge
re=(1:(f+1));
nre=setdiff(1:nx, re);

% remove the left edge
% nle--> no right edge
b=f+1; 
ig=1;

for e1=1:f;

    a=f+2-e1; 
    e2=0.5*(b^2+b-a^2+a)+1;
    ig=[ig e2];

end