The directory-specification utility FDCDIR

FDCDIR is a utility that builds pathnames for subdirectories of the FDC toolbox. It is called by several other programs from the toolbox to determine file-locations.

Due to the fact that the FDC root-directory will be different on different systems, referencing FDC subdirectories can be difficult. To facilitate this, the function FDCDIR was constructed. Calling this function for a user-specified FDC subdirectory will result in a complete path to this directory, that is: the subdirectory will be enhanced with the root-directory of the FDC toolbox.

If the resulting pathname does not exist, a warning message will be displayed. There are two possible causes for this condition to occur:

  1. the specified FDC subdirectory or the currently used root-directory is invalid,
  2. the specified root or subdirectory can't be found because it has been deleted or moved to another location. The location of the FDC root-directory will be obtained from the file fdc.ini. If that file can't be found, FDCDIR will try the default FDC root-location MATLABROOT\toolbox\fdc14.

Usage

D = fdcdir returns the root-directory of the FDC toolbox and stores it in the string-variable D.

D = fdcdir(NAME) returns the complete path of the FDC subdirectory specified in the string-variable NAME to the string variable D.

D = fdcdir(NAME1,NAME2) returns the complete path of the FDC sub-subdirectory specified in the string-variable NAME2, which itself is contained in the FDC subdirectory specified in the string-variable NAME2 (see the example below).

More input arguments are allowed (but not very practical), as long as the inputs are all string variables.

Examples

Suppose we call FDCDIR with the following command:

D = fdcdir('MODELS')

and C:\MATLAB\TOOLBOX\FDC14 is specified as root-directory in the file fdc.ini. This yields:

D = 'C:\MATLAB\TOOLBOX\FDC14\MODELS'.

Using this same root-directory, the command:

D = fdcdir('MODELS','AIRCRAFT')

will yield:

D = 'C:\MATLAB\TOOLBOX\FDC20\MODELS\AIRCRAFT'.

Note: even though Windows notation has been used for the pathnames in the examples and information above, the program itself makes use of generic path and file-separators.

Related utilities

The macro's DATADIR and HELPDIR make use of this function to specify the FDC data-directory and the location of the on-line helpfiles, respectively.