Skip to content

Instantly share code, notes, and snippets.

@scajanus
Created October 16, 2012 08:23
Show Gist options
  • Select an option

  • Save scajanus/3898027 to your computer and use it in GitHub Desktop.

Select an option

Save scajanus/3898027 to your computer and use it in GitHub Desktop.
function [record, gp, opt] = gp_mc(gp, x, y, varargin)
<snip>
ip=inputParser;
ip.FunctionName = 'GP_MC';
ip.addRequired('gp',@isstruct);
ip.addRequired('x', @(x) ~isempty(x) && isreal(x) && all(isfinite(x(:))))
ip.addRequired('y', @(x) ~isempty(x) && isreal(x) && all(isfinite(x(:))))
ip.addParamValue('z', [], @(x) isreal(x) && all(isfinite(x(:))))
ip.addParamValue('nsamples', 1, @(x) isreal(x) && all(isfinite(x(:))))
ip.addParamValue('repeat', 1, @(x) isreal(x) && all(isfinite(x(:))))
ip.addParamValue('display', 1, @(x) isreal(x) && all(isfinite(x(:))))
ip.addParamValue('record',[], @isstruct);
ip.addParamValue('hmc_opt', [], @(x) isstruct(x) || isempty(x));
ip.addParamValue('sls_opt', [], @(x) isstruct(x) || isempty(x));
ip.addParamValue('ssls_opt', [], @(x) isstruct(x) || isempty(x));
ip.addParamValue('latent_opt', [], @(x) isstruct(x) || isempty(x));
ip.addParamValue('lik_hmc_opt', [], @(x) isstruct(x) || isempty(x));
ip.addParamValue('lik_sls_opt', [], @(x) isstruct(x) || isempty(x));
ip.addParamValue('lik_gibbs_opt', [], @(x) isstruct(x) || isempty(x));
ip.addParamValue('persistence_reset', 0, @(x) ~isempty(x) && isreal(x));
<snip>
Parsed to:
---gp_mc
--'gp',@isstruct);, REQUIRED
--'x', @(x) ~isempty(x) && isreal(x) && all(isfinite(x(:)))), REQUIRED
--'y', @(x) ~isempty(x) && isreal(x) && all(isfinite(x(:)))), REQUIRED
--'z', [], @(x) isreal(x) && all(isfinite(x(:))))
--'nsamples', 1, isscalar @(x) isreal(x) && all(isfinite(x(:))))
--'repeat', 1, isscalar @(x) isreal(x) && all(isfinite(x(:))))
--'display', 1, @(x) isreal(x) && all(isfinite(x(:))))
--'record',[], @isstruct);
--'hmc_opt', [], @(x) isstruct(x) || isempty(x));
--'sls_opt', [], @(x) isstruct(x) || isempty(x));
--'latent_opt', [], @(x) isstruct(x) || isempty(x));
--'lik_hmc_opt', [], @(x) isstruct(x) || isempty(x));
--'lik_sls_opt', [], @(x) isstruct(x) || isempty(x));
--'lik_gibbs_opt', [], @(x) isstruct(x) || isempty(x));
--'persistence_reset', 0, isscalar @(x) ~isempty(x) && isreal(x));
--'RETURN', [record, gp, opt]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment