Main Content

copyTo

Class: matlab.automation.diagnostics.FileArtifact
Namespace: matlab.automation.diagnostics

Copy artifacts to new location

Syntax

newArtifacts = copyTo(artifact,destination)

Description

newArtifacts = copyTo(artifact,destination) copies artifacts to a new location and returns an array of updated matlab.automation.diagnostics.Artifact instances. The copyTo method sets the Location property on each instance of newArtifacts to destination.

Input Arguments

expand all

Artifacts to copy to a new location, specified as an array of matlab.automation.diagnostics.FileArtifact instances.

New location for the artifacts, specified as a character vector or string scalar.

Example: tempdir()

Example: "mySubFolder

Example: 'C:\work'

Examples

expand all

Create an array of file artifacts. This example assumes that files called someFile.m and anotherFile.m exist in your current folder.

import matlab.automation.diagnostics.FileArtifact
fileArtifact1 = FileArtifact('someFile.m');
fileArtifact2 = FileArtifact('anotherFile.m');
artifacts = [fileArtifact1 fileArtifact2];

Copy the artifacts to a temporary folder.

destination = tempdir();
newArtifacts = artifacts.copyTo(destination);

Version History

Introduced in R2017a