WARNING: loadset will be obsolete in future version of PIVMAT.
Use loadvec instead.
F = loadset loads all the vector/image fields of the current directory
into the structure array F. This is essentially equivalent to
F = loadvec({'*.vec','*.vc7','*.imx','*.im7'}), except that loadset
makes use of a MAT-file called 'set.mat' to save time (see below).
See loadvec for the content of the structure array F.
F = loadset(DIR) loads all the vector/image fields from the specified
directory DIR in the structure array F. If DIR is a cell array
(e.g. {'dir1','dir2'}), then loads all the files from each directory
and concatenates them in a single structure array F (see loadarrayvec
to load the files in a 2D structure array). Wildcards (*) may be used:
F = loadset('set*') loads all the files in all the directories matching
'set*'. Brackets ([]) are also accepted (see EXPANDSTR for details).
For example, F = loadset('set[1:3,1]') loads all the vector/scalar
fields from the directories 'set1', 'set2', 'set3'. DIR can be a cell
array with a combination of wildcards and brackets.
F = loadset(DIR, FILE) loads only the file(s) FILE in the directory(s)
DIR. This is useful when DIR and/or FILE are cell arrays and/or contain
wildcards (*) and/or brackets (see EXPANDSTR). This is equivalent to
F = loadvec([DIR '/' FILE]).
F = loadset(DIR, NUM) loads only the file number NUM in the directory(s)
DIR (works in alphanumeric order, only for VEC/VC7 and IMX/IM7 files).
NUM may be a simple number or any valid MATLAB vector (e.g., 1:10,
[1 10], 4:-1:1, etc.)
loadset(...) without output argument is a shortcut for
showvec(loadset(...)) or showscal(loadset(...))
Examples
V = loadset('myset') loads all the VEC/VC7 files in the directory
'myset' (loads the 'set.mat' file if it exists; see below).
showvec(loadset) displays all the files from the current directory.
V = loadset('set*','B00001.vec') loads the files 'B00001.vec'
contained in each directory 'set*'.
V = loadset('set*','*.vec') loads all the VEC files in each directory
'set*'.
V = loadset({'set1','set2'},{'file1.vec','B*.vec'}) loads 'file1.vec'
and all the VEC files 'B*' in the two directories 'set1' and 'set2'.
V = loadset('set*','B[5:10]*') loads 'B00005.vec' to 'B00010.vec' in
each directory 'set*' (see loadvec and EXPANDSTR for details).
V = loadset('set[200:5:400,2]*','B01.vec') loads the files 'B01.vec'
contained in each directory 'set200*','set205*','set210*' etc.
V = loadset('set*',1:10) loads the 10 first files from each directory
'set*'.
The first time loadset is used to load all the vector/scalar fields in a
directory (i.e. without the argument FILE), a MAT-file called 'set.mat'
containing the structure array F for all the files is created. The next
time loadset is used, this file 'set.mat' is loaded instead of each
original file, to save time (this may be 2 to 5 times faster). Once
this file 'set.mat' has been created, the original files are not
necessary any more.
F = loadset(...,'overwrite') loads the original vector/scalar fields
even if a 'set.mat' file already exists, and saves (overwrites) a new
'set.mat'.
F = loadset(...,'nosave') loads the original vector/scalar files even
if a 'set.mat' file already exists, and does not save the 'set.mat'
file.
See Also
loadvec, vec2mat, loadarrayvec, batchf, readsetfile, showvec, rdir.
Published output in the Help browser
showdemo loadset