fda (version 2.4.7)

fdaMatlabPath: Add 'fdaM' to the Matlab path

Description

Write a sequence of Matlab commands to fdaMatlabPath.m in the working directory containing commands to add fdaM to the path for Matlab.

Usage

fdaMatlabPath(R.matlab)

Arguments

R.matlab

logical: If TRUE, include '~R/library/R.matlab/externals' in the path. If(missing(R.matlab)) include '~R/library/R.matlab/externals' only if R.matlab is installed.

Value

A character vector of Matlab addpath commands is returned invisibly.

Details

  • USAGE If your Matlab installation does NOT have a startup.m file, it might be wise to copy fdaMatlabPath.m into a directory where Matlab would look for startup.m, then rename it to startup.m.

    If you have a startup.m, you could add the contents of fdaMatlabPath.m to startup.m.

    Alternatively, you can copy fdaMatlabPath.m into the directory containing startup.m and add the following to the end of startup.m:

    if exist('fdaMatlabPath')
    fdaMatlabPath ;

  • ALGORITHM 1. path2fdaM = path to the Matlab/fdaM subdiretory of the fda installation directory.

    2. Find all subdirectories of path2fdaM except those beginning in '@' or including 'private'.

    3. if(requires(R.matlab)) add the path to MatlabServer.m to dirs2add

    4. d2a <- paste("addpath('", dirs2add, "');", sep='')

    5. writeLines(d2a, 'fdaMatlabPath.m')

    6. if(exists(startupFile)) append d2a to it

References

Matlab documentation for addpath and startup.m.

See Also

Matlab, dirs

Examples

Run this code
# NOT RUN {
# Modify the Matlab startup.m only when you really want to,
# typically once per installation ... certaintly not
# every time we test this package.
fdaMatlabPath()
# }

Run the code above in your browser using DataCamp Workspace