replace
Syntax
Description
replaces the newPipeline = replace(pipeline,existingName,newComponent)existingName component in pipeline
with the component in newComponent. The function connects the new
component in the same way as the existing component it replaces.
In particular, the inputs of the new component connect to the same ports to which the inputs of the existing component were connected. The outputs of the new component are similarly connected to the ports that received outputs from the existing component.
Connections are made strictly by port order. That is, the first input port of the new component connects to the port that fed data to the first input port of the existing component, and likewise for the output ports.
You can specify a new component with fewer (but not more) inputs or outputs than the component it replaces.
[
additionally returns the name of the new component (newPipeline,newName] = replace(pipeline,existingName,newComponent)newName). Because
component names must be unique within a pipeline, the function might rename the component by
adding a numeric suffix (for example, _1).
Examples
Input Arguments
Output Arguments
Tips
Version History
Introduced in R2026a