Browse Source

Tiny fixes

master
Apostolos Fanakis 6 years ago
parent
commit
2e95d927d5
  1. 16
      spike_sorting.m

16
spike_sorting.m

@ -11,7 +11,7 @@
%%
%% =================================================================================================
%% S.1
clear
clear all
datasetMedians = zeros(8);
datasetFactors = zeros(8);
@ -84,15 +84,17 @@ for fileIndex=1:8
[minValue, closestIndex] = min(abs(numberOfSpikesTrimmed-Dataset.spikeNum));
datasetFactors(fileIndex) = thresholdFactorInitValue + (closestIndex - 1) * thresholdFactorStep;
clear {dataset, data}
clear dataset
clear data
end
fprintf('\n');
%% Q.1.3
figure();
plot(datasetMedians, datasetFactors, 'o');
title('Polynomial curve fitting on median-threshold factor value pairs');
xlabel('Dataset median');
ylabel('Threshold factor');
plot(datasetMedians, datasetFactors, 'o');
hold on;
empiricalRule = polyfit(datasetMedians, datasetFactors, 8);
visualizationX = linspace(0, 0.5, 50);
@ -102,9 +104,11 @@ hold off
%% =================================================================================================
%% S.2
clearvars closestIndex datasetFactors datasetMedians endValue minValue numberOfFactors ...
numberOfSpikesPerFactor numberOfSpikesTrimmed thresholdFactorEndValue thresholdFactorInitValue ...
thresholdFactorStep visualizationX visualizationY
clearvars = {'closestIndex' 'datasetFactors' 'datasetMedians' 'endValue' 'minValue' 'numberOfFactors' ...
'numberOfSpikesPerFactor' 'numberOfSpikesTrimmed' 'thresholdFactorEndValue' 'thresholdFactorInitValue' ...
'thresholdFactorStep' 'visualizationX' 'visualizationY'};
clear(clearvars{:})
clear clearvars
for fileIndex=1:4
fprintf('Loading evaluation dataset no. %d \n', fileIndex);

Loading…
Cancel
Save