From 2e95d927d5df8d1f8a6e67b93ef33d5d6529537c Mon Sep 17 00:00:00 2001 From: Apostolof Date: Fri, 28 Dec 2018 20:39:24 +0200 Subject: [PATCH] Tiny fixes --- spike_sorting.m | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/spike_sorting.m b/spike_sorting.m index 1c62a56..dea9d0a 100644 --- a/spike_sorting.m +++ b/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);