\documentclass{standalone}
\usepackage[useliterate]{mcode}  
\begin{document}

\begin{lstlisting}
function z = x2z(varargin)
%X2Z  Basic x2z function

%% read options

OPT = struct(                   ...
    'R',   0,                   ...     % resistance value
    'S',   0                    ...     % sollicitation value
);

OPT = setproperty(OPT, varargin{:});

%% compute z-values

z = OPT.R - OPT.S;
\end{lstlisting}

\end{document}