Main Content

matlabdrive

Root folder ofMATLABDrive

    Description

    example

    M= matlabdrivereturns the path to the folder that contains the content of yourMATLAB®Drive™.

    You can runmatlabdrivefrom your desktop or from other MATLAB environments such asMATLAB Online™. On desktop systems, you must haveMATLABDriveConnectorinstalled. If MATLAB is unable to find theMATLAB Drivefolder,matlabdrivereturns an error.

    Examples

    collapse all

    Get the location of yourMATLAB Drivefolder on a desktop system withMATLAB DriveConnector installed.

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

    If you know where a file is within yourMATLAB Drivefolder, you can also usematlabdriveto get the full path to the file.

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

    Tips

    • On a desktop system,MATLAB DriveConnector must be running and properly configured. Otherwise,matlabdrivereturns an error. For more information, seeInstall MATLAB Drive Connector(MATLAB Drive)andStart and Stop MATLAB Drive Connector(MATLAB Drive).

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

    Introduced in R2021a