Main Content

addAttachedFiles

Attach files or folders to parallel pool

    Description

    addAttachedFiles(pool,filenames) attaches files or folders to a parallel pool. The files or folders are immediately transferred to each worker in the parallel pool.

    If you specify files that are already attached to the pool, the files are not updated. To update attached files, use updateAttachedFiles.

    example

    Examples

    collapse all

    You can use addAttachedFiles and gcp to add files to the current parallel pool.

    Use addAttachedFiles to attach two files "myFun1.m" and "myFun2.m" to the current parallel pool. To get the current parallel pool, use gcp.

    addAttachedFiles(gcp,["myFun1.m" "myFun2.m"])

    Input Arguments

    collapse all

    Parallel pool to attach files to, specified as a parallel.Pool object.

    To create a parallel pool, use parpool.

    Files or folders to attach, specified as a string scalar, string array, character vector, or cell array of character vectors. Each character vector can specify either an absolute or relative path to a file or folder.

    If you specify a relative path, the path is relative to the current working directory on the client.

    Example: ["myFun1.m" "myFun2.m"]

    Data Types: string | char | cell

    Version History

    Introduced in R2013b