主要内容

fitmbcboundary

R2026b

Fit boundary model to new or existing data

Since R2026b

    Description

    B = fitmbcboundary(X) fits a boundary model to the data in X using the default boundary type. For single-column data, the default type is "Range". For data with multiple columns, the default type is "Convex hull".

    example

    B = fitmbcboundary(X,Type) specifies a boundary model type.

    example

    B = fitmbcboundary(X,Type,Name=Value) uses additional options specified by one or more name-value arguments to configure the boundary model before fitting.

    example

    Examples

    collapse all

    Fit a boundary model to 3-D data using the default type.

    X = randn(200,3);
    B = fitmbcboundary(X)

    Generate random 2-D data and fit a convex hull boundary model.

    X = randn(100,2);
    B = fitmbcboundary(X,"Convex hull")

    Fit a star-shaped boundary model using only the first two of three input variables.

    X = randn(150,3);
    B = fitmbcboundary(X,"Star-shaped",ActiveInputs=logical([1 1 0]))

    Fit a convex hull boundary model to 2-D data, and then use the Evaluate function to determine whether new points are inside or outside the boundary.

    Points with negative values are inside the boundary. Points with positive values are outside the boundary.

    X = randn(200,2);
    B = fitmbcboundary(X,"Convex hull");
    Xnew = rand(5,2)*6 - 3;
    d = Evaluate(B,Xnew);
    inside = Xnew(d <= 0,:);
    outside = Xnew(d > 0,:);

    Input Arguments

    collapse all

    Input data, specified as a numeric matrix with one column for each input variable of the boundary model. Each row represents one observation. The input ranges of the boundary model are determined from the minimum and maximum values in each column of X.

    Note

    For optimal performance, use fewer than eight columns.

    Data Types: double | table

    Boundary model type, specified as "Convex hull", "Range", "Ellipsoid", or "Star-shaped". "Range" is the only boundary model type that supports single-column data. When X has multiple columns, the default value is "Convex hull".

    Data Types: char | string

    Output Arguments

    collapse all

    Fitted boundary model, returned as an mbcboundary.Model object. The object contains the fitted boundary constraint and properties including the boundary type, input definitions, active inputs, and fit algorithm settings.

    Version History

    Introduced in R2026b