Skip to content

Commit

Permalink
Only save data if output_name is provided.
Browse files Browse the repository at this point in the history
  • Loading branch information
gmierz committed Mar 15, 2020
1 parent 6b4cdd3 commit 77b8050
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions eegfmri_clean.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
% EEG - The raw EEG data, should have a 5000Hz sampling rate.
% OPTIONAL INPUT:
% output_name - The name of the output of the cleaned EEG, if it's
% not given, defaults to `clean_eeg.set`.
% not given, the data won't be saved.
% minpeaks - The minimum distance (in points) between the BCG
% artifacts (defaults to 180 points).
% epochls - Size of the BCG artifact to extract (defaults to
Expand Down Expand Up @@ -50,8 +50,8 @@

% Setup optional arguments
if ~exist('output_name', 'var') || isempty(output_name)
output_name = 'clean_eeg.set';
disp('Output name was not provided, saving data as clean_eeg.set');
output_name = '';
disp('Output name was not provided, not saving data');
end
if ~exist('minpeaks', 'var') || isempty(minpeaks)
minpeaks = 180;
Expand Down Expand Up @@ -116,7 +116,9 @@
end
end

pop_saveset(neweeg, 'filename', output_name)
if ~isempty(output_name)
pop_saveset(neweeg, 'filename', output_name)
end
end


0 comments on commit 77b8050

Please sign in to comment.