hi
i want to move my .mat files from anywhere in my pc into specified directory
like : C:\Users\Rahaf\EE208\assignment\databasedir
by using guide
how to do this ?

 Réponse acceptée

Walter Roberson
Walter Roberson le 14 Mai 2019

0 votes

destdir = 'C:\Users\Rahaf\EE208\assignment\databasedir';
[filename, pathname] = uigetfile('*.mat', 'choose a file');
if ~ischar(filename)
return; %user cancel
end
sourcefile = fullfile(pathname, filename);
try
[success, message] = movefile(sourcefile, destdir);
if ~success
warndlg('Failed to move file "%s" to "%s" because "%s"', sourcefile, destdir, message);
return
end
catch ME
warndlg('Failed to move file "%s" to "%s" for some reason', sourcefile, destdir);
return
end
warndlg('file moved');

Plus de réponses (0)

Catégories

En savoir plus sur File Operations dans Centre d'aide et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by