필터 지우기
필터 지우기

Share content from Matlab cloud drive

조회 수: 7 (최근 30일)
Tero
Tero 2023년 11월 13일
답변: Dheeraj 2024년 6월 28일 6:10
Hello,
is it possible to perform the following actions from matlab command prompt?
  • Create a folder in Matlab Drive
  • Upload files into the folder
  • Share the folder
  • Get the link for sharing
I'd like to get these things done by a script, so I could then just send the sharing link via email
Thanks all,
Tero

채택된 답변

Dheeraj
Dheeraj 2024년 6월 28일 6:10
Hi Tero,
I understand you want to automate the entire process of uploading a file to MATLAB Drive and generating a shareable link.
Unfortunately, there is currently no way to generate a shareable link directly through the MATLAB command window. However, you can create and upload folders and files to your MATLAB Drive. Here is an example to do that:
% Define the folder name and path
folderName = 'nameOfTheFolderToSHare';
folderPath = fullfile(matlabdrive, folderName);
% Create the folder in MATLAB Drive
if ~exist(folderPath, 'dir')
mkdir(folderPath);
end
% Define the files to be uploaded (change to your file paths)
filePaths = {'/path/to/your/file1.m', '/path/to/your/file2.m'};
% Upload files to the created folder
for i = 1:length(filePaths)
[~, fileName, ext] = fileparts(filePaths{i});
destination = fullfile(folderPath, [fileName, ext]);
copyfile(filePaths{i}, destination);
end
To share the folder and generate a shareable link and manage user permissions for the link you still have to use the MATLAB UI.
To know more about managing files and folders in MATLAB you could refer to the below MATLAB's documentation.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Cloud Integrations에 대해 자세히 알아보기

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by