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: UnKronPolicyIndexes_Case1_FHorz.m
    path of file: ./repos/VFIToolkit-matlab/SubCodes/UnKronPolicyIndexes
    
    the code of the file until where you have to start completion: function Policy=UnKronPolicyIndexes_Case1_FHorz(Policy, n_d, n_a, n_z,N_j,vfoptions)

%Input: Policy=zeros(2,N_a,N_z,N_j); %first dim indexes the optimal choice for d and aprime rest of dimensions a,z 
%                       (N_a,N_z,N_j) if there is no d
%Output: Policy (l_d+l_a,n_a,n_z,N_j);

N_d=prod(n_d);
N_a=prod(n_a);

    
function Policy=UnKronPolicyIndexes_Case1_FHorz(Policy, n_d, n_a, n_z,N_j,vfoptions)

%Input: Policy=zeros(2,N_a,N_z,N_j); %first dim indexes the optimal choice for d and aprime rest of dimensions a,z 
%                       (N_a,N_z,N_j) if there is no d
%Output: Policy (l_d+l_a,n_a,n_z,N_j);

N_d=prod(n_d);
N_a=prod(n_a);
N_z=prod(n_z);

l_a=length(n_a);


% Sometimes numerical rounding errors (of the order of 10^(-16) can mean
% that Policy is not integer valued. The following corrects this by converting to int64 and then
% makes the output back into double as Matlab otherwise cannot use it in
% any arithmetical expressions.
if ~isfield(vfoptions,'policy_forceintegertype')
    vfoptions.policy_forceintegertype=0;
end