Main Content


FCM clustering options

Since R2023a


    Use an fcmOptions object to specify options for clustering data using the fcm function. You can specify options such as the number of clusters, the clustering exponent, and the distance metric.




    opt = fcmOptions returns a default option object for FCM clustering.

    opt = fcmOptions(Name=Value) specifies options using one or more name-value pair arguments. For example, to compute three clusters, use NumClusters=3.


    expand all

    Number of clusters to create, specified as "auto" or an integer greater than 1.

    When NumClusters is "auto", the fcm function computes two clusters.

    Exponent for the fuzzy partition matrix, specified as a scalar greater than 1.0. This option controls the amount of fuzzy overlap between clusters, with larger values indicating a greater degree of overlap.

    If your data set is wide with significant overlap between potential clusters, then the calculated cluster centers can be very close to each other. In this case, each data point has approximately the same degree of membership in all clusters. To improve your clustering results, decrease this value, which limits the amount of fuzzy overlap during clustering.

    For an example of fuzzy overlap adjustment, see Adjust Fuzzy Overlap in Fuzzy C-Means Clustering.

    Maximum number of iterations, specified as a positive integer.

    Minimum improvement in objective function between two consecutive iterations, specified as a positive scalar.

    Information display flag indicating whether to display the objective function value after each iteration, specified as one of the following values.

    • true — Display objective function.

    • false — Do not display objective function.

    Method for computing distance between data points and cluster centers, specified as one of the following values.

    • "euclidean" — Compute distance using a Euclidean distance metric, which corresponds to the classical FCM algorithm.

    • "mahalanobis" — Compute distance using a Mahalanobis distance metric, which corresponds to the Gustafson-Kessel FCM algorithm.

    Object Functions

    fcmFuzzy c-means clustering


    collapse all

    Create an fcmOptions object for computing three clusters using a maximum of 200 iterations.

    opt = fcmOptions(...

    You can also specify options using dot notation. For example, disable the command-window output of the objective function value for each FCM iteration.

    opt.Verbose = false;

    Version History

    Introduced in R2023a