%% Create Tar File of a Folder
% Create a tar file of a folder including all subfolders, and store the relative paths in the file.
% Create a folder myfolder containing a subfolder mysubfolder and the files membrane.m and logo.m.

mkdir myfolder;
movefile('membrane.m','myfolder');
movefile('logo.m','myfolder');
cd myfolder;
mkdir mysubfolder;
cd ..

%
% Create a tar file of the contents of myfolder, including all subfolders.

tarfiles = tar('myfiles.tar','myfolder');

%
% Copyright 2012 The MathWorks, Inc.