Skip to content

Instantly share code, notes, and snippets.

@alexlib
Created January 15, 2016 15:00
Show Gist options
  • Save alexlib/cffe7a86b9ed53bd8205 to your computer and use it in GitHub Desktop.
Save alexlib/cffe7a86b9ed53bd8205 to your computer and use it in GitHub Desktop.
Load PIVLab MAT files into PIVMAT
directory = '~/Desktop/ariel_piv/test_7_res';
fileList = dir(fullfile(directory,'test_7_*.mat'));
a = repmat(struct('x',[],'y',[],'vx',[],'vy',[],'choice',[],...
'unitx','px','unity','px','namex','x','namey','y',...
'unitvx','px/dt','unitvy','px/dt','namevx','vx','namevy','vy',...
'pivmat_version','3','ysign','','Attributes','',...
'name','','setname','','history',{{'PIVLab1.4'}},'source',''),1,length(fileList));
for i = 1:length(fileList)
load(fullfile(directory,fileList(i).name));
a(i).vx = transpose(u);
a(i).vy = transpose(v);
a(i).x = unique(x).';
a(i).y = unique(y).';
end
m = showf(filterf(interpf(a),1),'curl','all','spacing',2,'scalearrow',3,'rot');
% movie2avi(m,'test_7')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment