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

Loading…
Cancel
Save