I have another question again. I would like to copy all the files
whose names are defined in a cell array, for example, a={'a1', 'a2',
'a3'}, and to the destination files whose names are defined in another
cell array b={'b1', 'b2', 'b3'} whose size is the same as a.
Currently, I am using copyfile and a loop to copy each element in a to
b, but it is very slow since i have many files. Is there a way that I
can copy those all together without a loop? Like a matrix
manipulation?
Thanks for the help in advance.
> I would like to copy all the files
> whose names are defined in a cell array,
> Is there a way that I
> can copy those all together without a loop? Like a matrix
> manipulation?
No. Also, a couple of months ago, someone pointed out that copyfile
on MS Windows is fairly slow, much slower than it would appear to need to be.
The work-around would appear to be to create a system() command(s) that
perform the copies, using ispc() if you need to figure out which system
copy command to use. e.g, system('cp a1 b1; cp a2 b2; cp a3 b3')
You'll have to figure out, though, how to handle the situation where one
or more of the copies fail.
--
.signature note: I am now avoiding replying to unclear or ambiguous postings.
Please review questions before posting them. Be specific. Use examples of what you mean,
of what you don't mean. Specify boundary conditions, and data classes and value
relationships -- what if we scrambled your data or used -Inf, NaN, or complex(rand,rand)?
Thank you very much for the help, Walter.