PIVMat Function Reference<< Prev | Next >> 
loadvec
Loads vector/image fields

Description
F = loadvec(FILENAME) loads the vector/image fields matching FILENAME 
into the structure array F.  Supported file formats are: 
    .VEC      Vector field from DaVis 6. 
    .VC7      Vector field from DaVis 7. 
    .IMX,IMG  Image from DaVis 6. 
    .IM7      Image from DaVis 7. 
    .TXT      Vector field exported in TXT mode (see loadpivtxt) 
    .SET      Set of vector fields (see loadset for details) 
    .MAT      Any MATLAB file containing a valid structure array of 
              vector/scalar fields (e.g., files converted by vec2mat, or 
              the file 'set.mat' generated by loadset). 
The resulting structure array F can be displayed using showvec or 
showscal. For multi-frame images, only the first frame is loaded. Use 
vec2scal to compute scalar fields from vector fields. 
 
If FILENAME is a cell array, (e.g. {'B1.vec','B2.vec'}), then loadvec 
loads all the files in the structure array F. Wildcards (*) may be used 
(e.g., loadvec('B*.vec')). Brackets ([]) may also be used (see expandstr 
for details). For example, F = loadvec('B[2:2:6].vec') loads the files 
'B00002.vec','B00004.vec', 'B00006.vec'. 
 
To load directly all the vector/image fields of a directory, see loadset. 
 
F = loadvec(NUM) loads the file number NUM from the current directory 
(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], 2:2:8, 10:-1:1, etc.) 
 
loadvec without input argument first opens a dialog box for file 
selection. 
 
loadvec file_name or loadvec('file_name') without output argument is a 
shortcut for showvec(loadvec('file_name')). 
 
For vector fields, the structure F contains the following fields: 
   x,y:        vectors containing the X and Y coordinates 
   vx,vy:      matrices of the x and y components of the velocity 
   ysign:      string, upward or downward Y axis 
   namevx, unitvx, namex, unitx...:  strings 
   name:       name of the VEC/VC7 file from which originates V 
   setname:    name of the parent directory (called 'SET' in DaVis) 
   Attributes: Additional informations from DaVis (see getattribute) 
   choice:     An array of 6 integers, giving the 1st, 2nd, 3rd, 4th 
               choice vectors, the number of filled/processed vectors 
               and the number of missing vectors. 
   history:    Remind from which command V has been obtained 
 
For scalar fields, vx and vy are replaced by w (idem for namevx,...) 
 
Examples
 
   loadvec B00001.vc7 
   showvec(loadvec('*.vec')); 
   showscal(vec2scal(loadvec('B00001.vc7'),'rot')); 
   v=loadvec('B[2:2:6]*.v*'); 
   v=loadvec({'data1.set','data2.set'}); 
   v=loadvec(1:10); 
 
See Also
showvec, loadset, loadarrayvec, vec2mat, filterf, vec2scal, 
batchvec, expandstr, rdir. 

 Previous: loadsetNext: operf 

2005-2007 PIVMat Toolbox 1.60