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: export_cases.m
    path of file: ./repos/bnt/SLP/misc
    
    the code of the file until where you have to start completion: function S = export_cases(data, names, file, misv)
% filepath = export_cases(data, names, 'filename', missing_value)

    
function S = export_cases(data, names, file, misv)
% filepath = export_cases(data, names, 'filename', missing_value)
%  filename and missing_value [default [] if iscell(data) or -9999 if not] are optional
% 
% Exports BNT datasets to Netica cases (* for missing data)
%
% Written by Francois.Olivier.C.H@gmail.com
% 
% Informations could be found here http://www.norsys.com/downloads/
%
% version 80807

% inits
if nargin==1, file=['dnet' datestr(now,'-yymmdd-HHMMSS')]; end