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: beamforming_planar.m
    path of file: ./repos/Antenna_Theory_Analysis_and_Design_C.A.Balanis---MATLAB/Chapter 16/Beamforming
    
    the code of the file until where you have to start completion: %************************************************************************
%	Beamforming_planar
%************************************************************************
%   It is the Matlab function that simulates beamforming of planar array.
%*************************************************************************
%	Credits:
%		S. Bellofiore
% 
    
function that simulates beamforming of planar array.
%*************************************************************************
%	Credits:
%		S. Bellofiore
%       Zhiyong Huang
%-----------------------------------------------------------------------------

% Set output format data
format short e

% Generate output filename based on current time
cur_time = datevec(datestr(now));

ERR = 1;

save_in_file = input('\nDo you want to save reusults in file? ([n]/y):','s');
while(ERR ~= 0)
   if (isempty(save_in_file) | save_in_file == 'n')
       fprintf('------------Results will not be saved in file.-----------\n\n');
       ERR=0;
   elseif(save_in_file =='y')
       file_string = input('Input the desired output filename: ','s');
       ERR=0;
       fprintf('\n');
   else
       save_in_file=input('Do you want to save the results in file or not? ([n]/y):','s');
   end