"3">Set default values for parameters not set by user</h2><pre class="codeinput"><span class="keyword">if</span> nargin&lt;3
    opts =struct;
<span class="keyword">end</span>

<span class="keyword">if</span> ~isfield(opts,<span class="string">'display'</span>)
    opts.display = false;
<span class="keyword">end</span>

<span class="keyword">if</span> ~isfield(opts,<span class="string">'use_std'</span>)
    opts.use_std = false;
<span class="keyword">end</span>

<span class="keyword">if</span> ~isfield(opts