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: getTPM.m
    path of file: ./repos/audio_steganalysis_ml/feature_extract/base_modules
    
    the code of the file until where you have to start completion: %% Calculate transition probability matrix with threshold T (A1 -> A2)
% - F = getTPM(A1,A2,T)
% - Variabl
    
function F = getTPM(A1,A2,T)
% get transition probability matrix A1 --> A2, range -T..T
F = zeros(2*T+1);
dn = max(hist(A1(:), -T:T), 1);                                            % normalization factors

for i = -T:T
    FF = A2(A1 == i);                                                      % filtered version
    for j = -T:T
        F(i+T+1, j+T+1) = nnz(FF==j) / dn(i+T+1);
    end