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
fc
is amatlab.buildtool.io.File
array, then thetransform
method does not return aFile
array if you allow resizing. If you want the transformed file collection to be aFile
array, do not specifytf
astrue
.
Version History
Introduced in R2023b