Main Content


Examine or set default cluster profile

Since R2022b


    p = parallel.defaultProfile returns the name of the default cluster profile.


    oldProfile = parallel.defaultProfile(newProfile) sets the default profile to newProfile and returns the previous default profile.

    If you delete or have not set the default profile, parallel.defaultProfile returns 'Processes' as the previous default profile.

    You can save modified profiles by using the saveProfile or saveAsProfile functions on a cluster object. You can create, delete, import, and modify profiles with the Cluster Profile Manager. To access the Cluster Profile manager, in the Environment area of the MATLAB® desktop Home tab, click Parallel and then click Create and Manage Clusters.


    collapse all

    Display the names of all the available profiles and set the first in the list as the default.

    allProfiles = parallel.listProfiles
    oldProfile = parallel.defaultProfile(allProfiles{1});

    Set the profile named 'MyProfile' as the default.


    Set the profile named 'Profile2' as the new default. To backup the old profile name, store the old profile name in a variable with the name 'oldDefault'.

    oldDefault = parallel.defaultProfile('Profile2');
    ans =


    • If you set a new default profile, you can keep the old profile in your MATLAB workspace in case you need to reset the default profile.

    Version History

    Introduced in R2022b