Resultados de
An earlier tip suggested using MATLAB Drive to share and collaborate with others using MATLAB Online or MATLAB on desktop systems. Starting in MATLAB R2021a, there is yet another advantage of using this approach – the 'matlabdrive' function returns the path to the folder that contains the content of your MATLAB Drive.
After sharing their files, instructors sometimes direct students to navigate to a specified folder or add certain folders to the MATLAB search path. This ensures that MATLAB can discover the scripts, functions, and other files contained within. Since the MATLAB Drive folder may be installed in different locations on each users’ computer, this could not be done programmatically. Unfortunately, students may miss these instructions and encounter errors. The same can happen between peers working in groups.
Add the matlabdrive function in your code to obtain the path of the MATLAB Drive folder. You can then use functions cd and fullfile to navigate directly to that location or a subfolder. With addpath, you can also add these to the MATLAB search path. For example,
>> drivePath = matlabdrive drivePath = 'C:\Users\username\MATLAB Drive'
>> folderPath = fullfile(matlabdrive, ‘myfolder’) folderPath = 'C:\Users\username\MATLAB Drive\myfolder’
>> cd(folderPath) % Change current folder to ‘myfolder’ in 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 Drive Connector installed. If MATLAB is unable to find the MATLAB Drive folder, matlabdrive returns an error.
MATLAB Drive provides a common cloud-based storage location for your scripts, live scripts, and other MATLAB files. All files you place in your MATLAB Drive get backed up in the cloud. You can use it to send either a personal invitation or a view-only link to a shared folder. Its close integration with MATLAB and MATLAB Online make it the easiest way to share and collaborate with other MATLAB users.
For example, instructors can share a read-only folder of class material with their students. Students can collaborate with peers on a common shared folder for group projects, and subsequently share it with their instructor for assessment. Thanks to full integration with MATLAB Online, you can view, modify, and run such shared files from within a web browser with just a few clicks.
Use MATLAB Drive Connector to sync your files between your computers and MATLAB Online, eliminating the need for manual upload or download.