Reputation: 3003
How do I pass a cell array like
pathParts = {'D:', 'foo', 'matic'}
to fullfile
to obtain a complete path (i.e. D:\foo\matic
)?
Upvotes: 1
Views: 342
Reputation: 6863
As follows:
fullfile(pathParts{:})
By colon indexing of a cell array, MATLAB will return a comma separated list. This you can then easily pass to other functions.
Upvotes: 2