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: load_AGC_block.m
    path of file: ./repos/SAR-Synthetic-Aperture-Radar/1-SAR成像算法/0_Radarsat_1数据的成像及处理/0-预备：用来得到用于成像的原始数据
    
    the code of the file until where you have to start completion: function [AGC_atten_dB] = load_AGC_block( file_pre, first_rg_line, ...
                                        Nrg_lines_blk, block, UseMATfiles )
%
% -------------------------------------------------------------------------
% This program returns the RADARSAT-1 receiver attenuation values for 
% one block.  They are integers from 2 to 17, in 1 dB steps.
% -------------------------------------------------------------------------
% file_pre        : File prefix ( path + prefix + block number)
% first_rg_line   : First range line for the extracted data  
% Nrg_lines_blk   : Number of range lines in a block
% block           : the current block number
% UseMATfiles     : (0) using extract_AGC and the '_aux.dat' file
%                   (1) load 'AGC_attenuation_values.mat',
%                          which has the AGC values for every range line.
% -------------------------------------------------------------------------
% Created:  Nov 01, 2004  by Kaan Ersahin
% Modified: Nov 29, 2004  by Kaan Ersahin
% Modified: Dec 13, 2004  by Ian Cumming
%            - added UseMATfiles option
% -------------------------------------------------------------------------

if     UseMATfiles == 0  % extract AGC values from binary aux data file

    
function [AGC_atten_dB] = load_AGC_block( file_pre, first_rg_line, ...
                                        Nrg_lines_blk, block, UseMATfiles )
%
% -------------------------------------------------------------------------
% This program returns the RADARSAT-1 receiver attenuation values for 
% one block.  They are integers from 2 to 17, in 1 dB steps.
% -------------------------------------------------------------------------
% file_pre        : File prefix ( path + prefix + block number)
% first_rg_line   : First range line for the extracted data  
% Nrg_lines_blk   : Number of range lines in a block
% block           : the current block number
% UseMATfiles     : (0) using extract_AGC and the '_aux.dat' file
%                   (1) load 'AGC_attenuation_values.mat',
%                          which has the AGC values for every range line.
% -------------------------------------------------------------------------
% Created:  Nov 01, 2004  by Kaan Ersahin
% Modified: Nov 29, 2004  by Kaan Ersahin
% Modified: Dec 13, 2004  by Ian Cumming
%            - added UseMATfiles option
% -------------------------------------------------------------------------

if     UseMATfiles == 0  % extract AGC values from binary aux data file
    
    file_in = strcat(file_pre, '_aux.dat');
    tic    
    AGC_atten_dB = extract_AGC( file_in, Nrg_lines_blk );  
    toc
    
elseif UseMATfiles == 1   % load all AGC values from .mat file
    tic    
    file_in = 'AGC_attenuation_values.mat'
    load( file_in )
    
    first = first_rg_line + (Nrg_lines_blk * (block-1));
    last  = first + Nrg_lines_blk - 1;
    AGC_atten_dB = nom_attenuation( first : last );
    toc
end