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: Fmax_corr.m
    path of file: ./repos/FMUT
    
    the code of the file until where you have to start completion: %Calculate Fmax correction for a F-observed and the permutation
%distribution
%
%EXAMP
    
function is provided "as is" and any express or implied warranties 
%are disclaimed. 

%Copyright (c) 2017-2019, Eric Fields
%All rights reserved.
%This code is free and open source software made available under the 3-clause BSD license.

function [h, p, Fmax_crit, est_alpha] = Fmax_corr(F_obs, F_dist, alpha)
    
    global VERBLEVEL;
    
    %Some useful numbers
    [~, n_electrodes, n_time_pts] = size(F_dist);
    
    %Calculate Fmax distribution and Fmax critical value
    Fmax_dist = max(max(F_dist, [], 2), [], 3);
    Fmax_dist = sort(Fmax_dist);
    Fmax_crit = Fmax_dist(ceil((1-alpha) * length(Fmax_dist)));

    %Null hypothesis test
    h = F_obs > Fmax_crit;
    est_alpha = mean(Fmax_dist > Fmax_crit);
    if VERBLEVEL
        fprintf('Estimated alpha level is %f\n', est_alpha);
    end