Skip to content

Commit

Permalink
fix some warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanharvey1 committed Nov 20, 2024
1 parent b0cc816 commit 486fad0
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions lfp/getEMGFromLFP.m
Original file line number Diff line number Diff line change
Expand Up @@ -88,19 +88,19 @@
%% Check if EMGCorr has already been calculated for this recording
%If the EMGCorr file already exists, load and return with EMGCorr in hand
if exist(matfilename, 'file') && ~overwrite
display('EMGFromLFP Correlation already calculated - loading from EMGFromLFP.LFP.mat')
disp('EMGFromLFP Correlation already calculated - loading from EMGFromLFP.LFP.mat')
load(matfilename)
if exist('EMGCorr', 'var') %for backcompatability
EMGFromLFP = EMGCorr;
end
if ~exist('EMGFromLFP', 'var')
display([matfilename, ' does not contain a variable called EMGFromLFP'])
disp([matfilename, ' does not contain a variable called EMGFromLFP'])
end
return
end
display('Calculating EMGFromLFP from High Frequency LFP Correlation')
disp('Calculating EMGFromLFP from High Frequency LFP Correlation')

load(fullfile(basepath, [recordingname, '.session.mat']))
load(fullfile(basepath, [recordingname, '.session.mat']), 'session')
nChannels = session.extracellular.nChannels;
SpkGrps = session.extracellular.spikeGroups.channels;
Fs = session.extracellular.srLfp;
Expand Down Expand Up @@ -138,8 +138,10 @@
% get list of spike groups (aka shanks) that should be used
usablechannels = [];
spkgrpstouse = [];
if length(SpkGrps) > 1, n = 1;
else n = 5;
if length(SpkGrps) > 1
n = 1;
else
n = 5;
end
for gidx = 1:length(SpkGrps)
usableshankchannels{gidx} = setdiff(SpkGrps{gidx}, rejectChannels);
Expand Down Expand Up @@ -248,7 +250,7 @@
EMGFromLFP.detectorName = 'getEMGFromLFP';
EMGFromLFP.samplingFrequency = samplingFrequency;

if ~any(~isnan(EMGFromLFP.data)),
if ~any(~isnan(EMGFromLFP.data))
keyboard
end
if saveMat
Expand Down

0 comments on commit 486fad0

Please sign in to comment.