Skip to content

in_script.m

Basic Information

  SYNTAX:
         in_script

  PURPOSE:  reads variable identified by string vnam into function from calling
            area or from base area, in this order

  INPUT:
     vnam=  name of variable to bring in from calling or base area
               ex: vnam='vac_objects'; vnam='time'; vnam= 'ip'; ...

  OUTPUT:

    variable identified by string vnam is set in routine from calling or base area
    dumm=     1 if variable set, 0 if variable not found and not set

  EXAMPLE USE in Function to allow call of function as script

  if nargin <= 0
    vnam= 'rbs'; in_script; if ~dumm return; end
    vnam= 'minimize_i'; in_script
  end

    NOTE: This script when used inside a function allows the function to act
          like a script for input. If variable doesnt exist it does not set

  RESTRICTIONS:
       vnam must be a character variable

 Caution: overwrites variable identified in vnam in routine and variable dumm

 see also ot_script

Dependencies