Contenuto principale

disconnect

Remove connections between ports in pipeline

Since R2026a

    Description

    newPipeline = disconnect(pipeline,connections) removes the connections listed in connections from the pipeline pipeline.

    example

    Examples

    collapse all

    Create a pipeline with two components and display the connections.

    featureSelector = featureSelectionClassificationMRMRComponent;
    knnClassifier = classificationKNNComponent;
    pipeline = series(featureSelector,knnClassifier);
    pipeline.Connections
    ans =
    
      7×2 table
    
                            Source                                     Destination              
        ______________________________________________    ______________________________________
    
        "X"                                               "FeatureSelectionClassificationMRMR/X"
        "Y"                                               "FeatureSelectionClassificationMRMR/Y"
        "FeatureSelectionClassificationMRMR/XSelected"    "ClassificationKNN/Predictors"        
        "Y"                                               "ClassificationKNN/Response"          
        "ClassificationKNN/Predictions"                   "Predictions"                         
        "ClassificationKNN/Scores"                        "Scores"                              
        "ClassificationKNN/Loss"                          "Loss"                   
    

    The XSelected output of the FeatureSelectionClassificationMRMR component is connected to the Predictors input of the ClassificationKNN component.

    Disconnect the two ports. View the pipeline.

    newPipeline = disconnect(pipeline, ...
        ["FeatureSelectionClassificationMRMR/XSelected", ...
        "ClassificationKNN/Predictors"]);
    view(newPipeline)

    Pipeline after disconnecting ports

    XSelected is disconnected from the Predictors input of the KNN component.

    Input Arguments

    collapse all

    Existing pipeline, specified as a LearningPipeline object.

    Names of the connections to remove, specified as a string array or cell array of character vectors, indicating ordered pairs of sources and destinations, or a table with two columns (Source and Destination). The format of connections must be the same as the format of the Connections property of the pipeline. You can find the name of a component in a pipeline by using the describe object function (for example, describe(pipeline)). describe also displays the component input and output port names.

    Data Types: string | cell | table

    Output Arguments

    collapse all

    Pipeline with connections removed, returned as a LearningPipeline object.

    More About

    collapse all

    Version History

    Introduced in R2026a