Main Content


Root folder of MATLAB Drive

Since R2021a



    M = matlabdrive returns the path to the folder that contains the content of your MATLAB® Drive™.

    You can run matlabdrive from your desktop or from other MATLAB environments such as MATLAB Online™. On desktop systems, you must have MATLAB Connector installed. If MATLAB is unable to find the MATLAB Drive folder, matlabdrive returns an error.


    collapse all

    Get the location of your MATLAB Drive folder on a desktop system with MATLAB Connector installed.

    md = matlabdrive
    md = 
        'C:\Users\username\MATLAB Drive'

    If you know where a file is within your MATLAB Drive folder, you can also use matlabdrive to get the full path to the file.

    md = fullfile(matlabdrive,'myfolder','myfunction.m')
    md = 
        'C:\Users\username\MATLAB Drive\myfolder\myfunction.m'

    Set the current folder to your MATLAB Drive folder.



    • On a desktop system, MATLAB Connector must be running and properly configured. Otherwise, matlabdrive returns an error. For more information, see Use MATLAB Connector to Manage Your Files.

    • On a MATLAB Parallel Server™ cluster provisioned through Cloud Center, the cluster must be configured as a personal cluster with a dedicated head node. Otherwise, matlabdrive returns an error.

    Version History

    Introduced in R2021a