So I am using this piece of code to copy some files with similar names from several destination paths (e.g. file03431314, file6767464363, etc).
When I use 'file*' it assumes it is a directory, which is not...
When I actualy copy and paste the filename, e.g. 'file03431314', it works fine.
PS: the file that I want to copy does not have an extension.
How can I fix this?
p1 = 'filepath'
pdest = 'mydestinationpath';
filename = 'file*';
source = fullfile(p1,filename);
destination = fullfile(pdest,filename);
oldname = filename;
newname = '1_file.txt';