0001 function ev_info = make_motion_evs(par_fname,outdir,outstub)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 if nargin < 2
0013 outdir = '';
0014 outstub = '';
0015 end
0016
0017 ev_info = create_ev_info;
0018
0019 if ~exist(par_fname)
0020 fprintf('Movement parameter file <%s> does not exist\n', par_fname);
0021 return
0022 end
0023
0024
0025 data = load(par_fname);
0026
0027 ncol = size(data,2);
0028 if ncol ~= 6
0029 fprintf('Parameter file <%s> does not have 6 columns\n', par_fname);
0030 return
0031 end
0032
0033 ev_info.set_type = 'motion';
0034 ev_info.ev_names = {'pitch','roll','yaw','trans_x','trans_y','trans_z'};
0035 ev_info.nev = 6;
0036
0037 for icol = 1:ncol
0038 outfname = fullfile(outdir,sprintf('%s_motion_ev%d.txt', outstub,icol));
0039 tmp = data(:,icol);
0040
0041 fprintf('Writing %s\n', outfname);
0042 save(outfname,'tmp','-ascii');
0043
0044
0045 ev_info.fnames{icol} = outfname;
0046 end
0047
0048 return
0049