r_figs_pos_all.m 2.42 KB
function r_figs_pos_all(nbF)
% R_FIGS_POS - Produces some figures usign data from r_data_pos.
%
% Syntax:  R_FIGS_POS
%
% Inputs: 
%     nbF          - The number of floes (40 or 80)
%
%
% Example:
%    r_figs_pos
%
% Other m-files required: 
% Subfunctions: none
% MAT-files required: figs_data_5f_expNumber_camNumer_rowNumber.mat
%                             (produced by R_FIGS_DATA) 
%                     list.mat 
%
% See also: R_DATA_POS
%
% Author: Marie-Pier Marquis, Dany Dumont
% UQAR/ISMER
% email: dany_dumont@uqar.ca
% Website: http://www.ismer.ca/dumont-dany
% July 2014, Last revision: October 2014
% ______________________________________________________________________
%%
nbFStr  = num2str(nbF);                      
if nbF == 80
    e1 = 201307241037; % same experiment as 201307241018
    e2 = 201307241056; % same experiment as 201307241018
elseif nbF == 40
    e1 = 201307251513; % same experiment as 201307251413
    e2 = 201307251532; % same experiment as 201307251413
end


%% Open files
rootdir  = r_root(nbF);
infofile = [rootdir,'/info.mat'];
listfile = [rootdir,'/list1.mat'];
load(infofile)
load(listfile)

fps      = info.fps;
ave      = info.average;
type     = info.waveType;
res      = info.result;
figsdata = info.figsData;
fpsStr   = num2str(fps);
aveStr   = num2str(ave);
%% Different figures, experiment by experiment.
for i = 1 : length(list1.exp) 
    if list1.nf(i)==nbF && list1.wt(i)==type && list1.exp(i)~=e1 &&...
            list1.exp(i)~=e2        
        % Data from list1
        expNumber = list1.exp(i);
        exp       = num2str(expNumber); 
        % Count the number of rows
        rowCounter = 0;                     
        for c = 1:4
            cam = num2str(c);
            for r = 1:4
                rowCounter = rowCounter + 1;
                row        = num2str(r);
                expdir     = [rootdir,'/',exp,'_multicam'];
                resdir     = [expdir,'/',fpsStr,'fps_',nbFStr,'f_',aveStr,res];
                datafile   = [resdir,figsdata,fpsStr,'fps_',nbFStr,'f_',...
                                    aveStr,'_',exp,'_',cam,'_',row,'.mat'];
                cd(resdir)
                
                % Remove row with accelerometer (rows 7 and 10)
                if  exist(datafile,'file') && rowCounter ~= 7 &&...
                        rowCounter ~= 10
                    r_figs_pos(expNumber, c, r,nbF)
                end
            end
        end
    end
end
end