transform
Class: matlab.buildtool.io.FileCollection
Namespace: matlab.buildtool.io
Description
newfc = transform(
transforms the paths of the file collection fc,fcn)fc with the function handle
fcn. The method returns the transformed file collection as a
matlab.buildtool.io.FileCollection array the same size as
fc. The paths of the original and transformed file collections have a
one-to-one correspondence.
You can use newfc to specify task inputs and outputs. For more
information about task inputs and outputs, see Improve Performance with Incremental Builds.
newfc = transform(
also specifies whether the number of paths of fc,fcn,AllowResizing=tf)fc and
newfc can differ. If tf is
true, a one-to-one correspondence between the paths of the original and
transformed file collections is not required. For example, if fc is a
file collection of .m files, newfc = transform(fc,@(paths)
[paths replace(paths,".m",".p")],AllowResizing=true) creates a file collection
with twice the number of paths in fc, including the original
.m files as well as their corresponding P-code files.
Input Arguments
Examples
Tips
If
fcis amatlab.buildtool.io.Filearray, then thetransformmethod does not return aFilearray if you allow resizing. If you want the transformed file collection to be aFilearray, do not specifytfastrue.
Version History
Introduced in R2023b