Skip to content
Snippets Groups Projects
Select Git revision
  • b8078501148558abdce7b71540506f877af7b728
  • master default protected
  • archive
  • v7.14.3
  • v7.14.2
  • v7.14.1
  • v7.14
  • v7.13
  • v7.12
  • v7.11
  • v7.10
  • v7.9
  • v7.8
  • v7.7
  • v7.6
  • v7.5
  • v7.4
  • v7.3
  • v7.3_MultiCellType
  • v7.2
  • v7.2_MultiCell
  • v7.1
  • v7.1_MultiCell
23 results

AddConstant.m

Blame
  • AddConstant.m 530 B
    function AddConstant(field,val,overWrite)
    % AddConstant(field,val,overWrite) will add the given field to the
    % CONSTANTS global variable and assign it the given value.
    % overWrite - is an optional flag {0,1} that will force the new value if
    % the field exists. Zero will keep the old value, One will overwrite the
    % current value
    
    %--Eric Wait
    
    global CONSTANTS
    
    if(~exist('overWrite','var'))
        overWrite = 0;
    end
    
    if(~isfield(CONSTANTS,field))
        CONSTANTS.(field) = val;
    elseif(overWrite)
        CONSTANTS.(field) = val;
    end
    end