a b/functions/adminfunc/eeg_hist.m
1
% EEG_HIST - history for EEGLAB dataset.
2
%
3
% Usage:
4
%   >> EEGOUT = eeg_hist( EEGIN, command );
5
%
6
% Inputs:
7
%   EEGIN   - input dataset
8
%   command - [string] eeglab command
9
%
10
% Author: Arnaud Delorme, SCCN/INC/UCSD, Dec 2003
11
%
12
% See also: EEGH, EEGLAB
13
14
% Copyright (C) 2003 Arnaud Delorme, SCCN/INC/UCSD, arno@salk.edu
15
%
16
% This file is part of EEGLAB, see http://www.eeglab.org
17
% for the documentation and details.
18
%
19
% Redistribution and use in source and binary forms, with or without
20
% modification, are permitted provided that the following conditions are met:
21
%
22
% 1. Redistributions of source code must retain the above copyright notice,
23
% this list of conditions and the following disclaimer.
24
%
25
% 2. Redistributions in binary form must reproduce the above copyright notice,
26
% this list of conditions and the following disclaimer in the documentation
27
% and/or other materials provided with the distribution.
28
%
29
% THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
30
% AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
31
% IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
32
% ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
33
% LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
34
% CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
35
% SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
36
% INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
37
% CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
38
% ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
39
% THE POSSIBILITY OF SUCH DAMAGE.
40
41
function EEG = eeg_hist( EEG, command )
42
43
if nargin < 2
44
    help eeg_hist;
45
end
46
47
if ~isfield(EEG, 'history')
48
    EEG.history = '';
49
end
50
51
if ~isempty(command) &&  isempty(strfind(command, 'pop_loadset'))
52
    try
53
        EEG.history = [ EEG.history 10 command ];
54
    catch
55
        EEG.history = strvcat(EEG.history, command);
56
    end
57
end