get_fnl nonintrusive input dimension

get_fnl nonintrusive input dimension

function input_dim = get_fnl_non_input_dim(fnl_non,n,N)

try

    v = zeros(n,1);
    fnl_non(v);
    input_dim = n;

catch

    try
        v = zeros(N,1);
        fnl_non(v);
        input_dim = N;
    catch

        error('Please check input dimension for the nonlinearity function handle')
    end
end


end