newzad
newzad

Reputation: 706

Compress a folder using tar in MATLAB

I try compress a folder in MATLAB using tar. I want to assign the current date as the name of the archive file. When I try

tar 'datestr(now)' FooFolder

Nothing happens. With

tar datestr(now) FooFolder

the name of the archive file is datestr(now).tar as expected. What is the solution?

Upvotes: 0

Views: 253

Answers (1)

Oleg
Oleg

Reputation: 10676

The documentation is quite clear, use the function syntax:

tar(tarfilename,files)

Example:

tar(datestr(now),'FooFolder')

Upvotes: 3

Related Questions