Home > source > defaultsfiller.m

# defaultsfiller

## PURPOSE

fill in default values to the missing fields in penm structure

## SYNOPSIS

function penm=defaultsfiller(penm)

## DESCRIPTION

     fill in default values to the missing fields in penm structure
     so that I don't need to check if they exist
     all except callbacks and xinit, Yinit

## CROSS-REFERENCE INFORMATION

This function calls:

This function is called by:

## SOURCE CODE

    0001 % fill in default values to the missing fields in penm structure
    0002 % so that I don't need to check if they exist
    0003 % all except callbacks and xinit, Yinit
    0004 function penm=defaultsfiller(penm)
    0005
    0006   if (~isfield(penm,'probname') || isempty(penm.probname))
    0007     penm.probname=penlab.default_probname();
    0008   end
    0009
    0010   if (~isfield(penm,'comment'))
    0011     penm.comment='';
    0012   end
    0013
    0014   if (~isfield(penm,'userdata'))
    0015     penm.userdata=[];
    0016   end
    0017
    0018   if (~isfield(penm,'opts'))
    0019     penm.opts=struct();
    0020   end
    0021
    0022   if (~isfield(penm,'Nx'))
    0023     penm.Nx=0;
    0024   end
    0025
    0026   if (~isfield(penm,'NY'))
    0027     penm.NY=0;
    0028   end
    0029
    0030   if (~isfield(penm,'Y'))
    0031     penm.Y=cell(penm.NY,1);
    0032   end
    0033
    0034   if (~isfield(penm,'lbx'))
    0035     penm.lbx=-Inf(penm.Nx,1);
    0036   end
    0037
    0038   if (~isfield(penm,'ubx'))
    0039     penm.ubx=Inf(penm.Nx,1);
    0040   end
    0041
    0042   if (~isfield(penm,'lbxbar'))
    0043     penm.lbxbar=[];
    0044   end
    0045
    0046   if (~isfield(penm,'ubxbar'))
    0047     penm.ubxbar=[];
    0048   end
    0049
    0050   if (~isfield(penm,'lbY'))
    0051     penm.lbY=-Inf(penm.NY,1);
    0052   end
    0053
    0054   if (~isfield(penm,'ubY'))
    0055     penm.ubY=Inf(penm.NY,1);
    0056   end
    0057
    0058   if (~isfield(penm,'lbYbar'))
    0059     penm.lbYbar=[];
    0060   end
    0061
    0062   if (~isfield(penm,'ubYbar'))
    0063     penm.ubYbar=[];
    0064   end
    0065
    0066   if (~isfield(penm,'lbYx'))
    0067     % cell array of empty matrices --> will use default values
    0068     penm.lbYx=cell(penm.NY,1);
    0069   end
    0070
    0071   if (~isfield(penm,'ubYx'))
    0072     penm.ubYx=cell(penm.NY,1);
    0073   end
    0074
    0075   if (~isfield(penm,'NgNLN'))
    0076     penm.NgNLN=0;
    0077   end
    0078
    0079   if (~isfield(penm,'NgLIN'))
    0080     penm.NgLIN=0;
    0081   end
    0082
    0083   if (~isfield(penm,'NANLN'))
    0084     penm.NANLN=0;
    0085   end
    0086
    0087   if (~isfield(penm,'NALIN'))
    0088     penm.NALIN=0;
    0089   end
    0090
    0091   if (~isfield(penm,'lbg'))
    0092     penm.lbg=-Inf(penm.NgNLN + penm.NgLIN,1);
    0093   end
    0094
    0095   if (~isfield(penm,'ubg'))
    0096     penm.ubg=Inf(penm.NgNLN + penm.NgLIN,1);
    0097   end
    0098
    0099   if (~isfield(penm,'lbA'))
    0100     penm.lbA=-Inf(penm.NANLN + penm.NALIN,1);
    0101   end
    0102
    0103   if (~isfield(penm,'ubA'))
    0104     penm.ubA=Inf(penm.NANLN + penm.NALIN,1);
    0105   end
    0106
    0107   %if (~isfield(penm,'Y'))
    0108   %  penm.Y=;
    0109   %end
    0110
    0111
    0112
    0113