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: fig2plotly.m
    path of file: ./repos/plotly_matlab/plotly
    
    the code of the file until where you have to start completion: function p = fig2plotly(varargin)

%------------------------------FIG2PLOTLY---------------------------------%

% Convert a MATLAB figure to a Plotly Figure

% [CALL]:

% p = fig2plotly
% p = fig2plotly(fig_han)
% p = fig2plotly(fig_han, 'property', value, ...)

% [INPUTS]: [TYPE]{default} - description/'options'

% fig_han: [handle]{gcf} - figure handle
% fig_struct: [structure array]{get(gcf)} - figure handle structure array

    
function p = fig2plotly(varargin)

%------------------------------FIG2PLOTLY---------------------------------%

% Convert a MATLAB figure to a Plotly Figure

% [CALL]:

% p = fig2plotly
% p = fig2plotly(fig_han)
% p = fig2plotly(fig_han, 'property', value, ...)

% [INPUTS]: [TYPE]{default} - description/'options'

% fig_han: [handle]{gcf} - figure handle
% fig_struct: [structure array]{get(gcf)} - figure handle structure array

% [VALID PROPERTIES / VALUES]:

% filename: [string]{'untitled'} - filename as appears on Plotly
% fileopt: [string]{'new'} - 'new, overwrite, extend