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: RFT_smoothness.m
    path of file: ./repos/VBA-toolbox/modules/random_field_theory
    
    the code of the file until where you have to start completion: function [fwhm] = RFT_smoothness(X)
% estimates the smoothness of a Gaussian RF sampled on a regular lattice
% [fwhm] = RFT_smoothness(X)

    
function [fwhm] = RFT_smoothness(X)
% estimates the smoothness of a Gaussian RF sampled on a regular lattice
% [fwhm] = RFT_smoothness(X)
% Note: if X is a Lxn matrix, then RFT_smoothness assumes that columns of X
% are repeated measures of the field (whose dimension is L).
% IN:
%   - X: Lxn matrix of sampled RF
% OUT:
%   - fwhm: field's smoothness (in voxels)

[L,n] = size(X);
if n>1 % normalize field across repetitions (if #repetitions>1)
    sx2= var(X,[],2);
    X = X./repmat(sqrt(sx2),1,n);
end