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: saveash5.m
    path of file: ./repos/NoRMCorre
    
    the code of the file until where you have to start completion: function saveash5(data, path_to_file, options)

% save the variable stored in data in a h5 file named path_to_file (includes the
% path to the directory). The file is saved with the same class as data.
% options.groupname: the name of the group (default: /mov)
% options.append: append to existing file if it exists (default: True)

if ~exist('path_to_file','var'); path_to_file = 'data.h5'; end
[pathstr, name, ~] = fileparts(path_to_file);

    
function saveash5(data, path_to_file, options)

% save the variable stored in data in a h5 file named path_to_file (includes the
% path to the directory). The file is saved with the same class as data.
% options.groupname: the name of the group (default: /mov)
% options.append: append to existing file if it exists (default: True)

if ~exist('path_to_file','var'); path_to_file = 'data.h5'; end
[pathstr, name, ~] = fileparts(path_to_file);
path_to_file = fullfile(pathstr,[name,'.h5']); % make sure file has an h5 extension
data_type = class(data);

sizY = size(data);
nd = ndims(data)-1;

defoptions.groupname = '/mov';
defoptions.append