summaryrefslogtreecommitdiff
path: root/code/matlab/random_spikes.m
diff options
context:
space:
mode:
Diffstat (limited to 'code/matlab/random_spikes.m')
-rw-r--r--code/matlab/random_spikes.m15
1 files changed, 15 insertions, 0 deletions
diff --git a/code/matlab/random_spikes.m b/code/matlab/random_spikes.m
new file mode 100644
index 0000000..89baf02
--- /dev/null
+++ b/code/matlab/random_spikes.m
@@ -0,0 +1,15 @@
+% fill the extenrally
+%num_neurons = 2; % wich should receive a spike
+%spike_freq = 1; % local per neuron per second
+%duration = 2; % [s]
+
+current = 100; % this should drive my neurons crazy
+
+format long
+
+num = num_neurons * spike_freq * duration;
+res = [ sort(rand(num, 1) .* duration), floor(rand(num, 1) .* num_neurons), ones(num, 1) * current ];
+
+for i=1:length(res),
+ fprintf(2,'%f,%d,%f\n', res(i,1), int32(floor(res(i,2))), res(i,3))
+end
contact: Jan Huwald // Impressum