{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "0b85a598", "metadata": {}, "outputs": [], "source": [ "from brian2 import *\n", "\n", "from adex_sine import *\n", "\n", "defaultclock.dt = 10 * us\n", "\n", "\n", "class Model:\n", " # Model type flags\n", " SINE = 0\n", " EXP2SYN = 1\n", "\n", " # Noise flags\n", " HIGH = 0\n", " LOW = 1\n", " OFF = -1\n", "\n", " # Noise parameters\n", " EXCITATORY_NOISE_VARIANCE = {HIGH: 0.5 * nS, LOW: 0.25 * nS, OFF: 0 * nS}\n", " INHIBITORY_NOISE_VARIANCE = {HIGH: 1.25 * nS, LOW: 0.625 * nS, OFF: 0 * nS}\n", "\n", " # Noise mean conductance\n", " EXCITATORY_CONDUCTANCE = 1 * nS\n", " INHIBITORY_CONDUCTANCE = 4 * nS\n", "\n", " DEFAULT_PARAMETERS = {\n", " \"sigma_flux\" : 6.75*pA, \n", " \"c\": 85 * pF,\n", " \"tau_w\": 18 * ms,\n", " \"b\": 0.25 * nA,\n", " \"a\": 1.3 * nS,\n", " \"v_T\": -45 * mV,\n", " \"v_thresh\": 0 * mV,\n", " \"DeltaT\": 0.2 * mV,\n", " # EQUILIBRIUM POTENTIAL\n", " \"e_l\": -65 * mV,\n", " \"e_ex\": 0 * mV,\n", " \"e_in\": -70 * mV,\n", " # CONDUCTANCES\n", " \"g_l\": 3 * nS,\n", " \"mu_ex\": 0 * nS,\n", " \"mu_in\": 0 * nS,\n", " # EXCITATORY NOISE\n", " \"sigma_ex\": 0 * nS,\n", " \"tau_noise_ex\": 3 * ms,\n", " # INHIBITORY NOISE\n", " \"sigma_in\": 0 * nS,\n", " \"tau_noise_in\": 10 * ms,\n", " # SINE INPUT\n", " \"f\": 100 * Hz,\n", " \"A\": 0 * pA,\n", " \"i_injected\": 0 * pA,\n", " \"v_reset\": -70 * mV,\n", " # m current\n", " \"g_adapt\": 10 * nS,\n", " \"e_k\": -90*mV,\n", " \"beta_z\": -35*mV,\n", " \"gamma_z\": 4*mV, #5\n", " \"tau_z\": 100*ms,\n", " }\n", "\n", " def __init__(\n", " self, n, *, stim=None, noise=None, resistance=None, additional_vars=()\n", " ):\n", " if resistance is None:\n", " raise ValueError(\"Resistance must be specified\")\n", "\n", " if noise is None:\n", " raise ValueError(\"Noise must be specified\")\n", "\n", " self.stim_type = stim\n", " self._input_resistance = None\n", " self._noise_level = None\n", " self._duration = 0\n", " self.recorded_vars = (\"v\",) + additional_vars\n", "\n", " self.neurons = self.set_default(n_neuron=n)\n", " self.set_resistance(resistance)\n", " self.set_noise(noise)\n", "\n", " self.spikes = None\n", " self.spiker = None\n", " self.synapses = None\n", " self.inhib_synapses = None\n", " self.smon = None\n", " self.network = None\n", " self.build_network()\n", "\n", " def create_model(self):\n", " return ADEX_MODEL, self.DEFAULT_PARAMETERS\n", "\n", " def set_default(self, n_neuron):\n", " model, parameters = self.create_model()\n", "\n", " neurons = NeuronGroup(\n", " n_neuron,\n", " model=model,\n", " method=\"Euler\",\n", " name=\"neurons\",\n", " threshold=\"v > v_thresh\",\n", " reset=\"v = v_reset; w += b\",\n", " )\n", "\n", " for parameter, value in parameters.items():\n", " neurons.__setattr__(parameter, value)\n", "\n", " neurons.v = neurons.e_l # remove most of transient\n", "\n", " return neurons\n", "\n", " def set_resistance(self, level):\n", " if level == self.LOW:\n", " exc_conductance = self.EXCITATORY_CONDUCTANCE\n", " inhib_conductance = self.INHIBITORY_CONDUCTANCE\n", "\n", " else:\n", " exc_conductance = inhib_conductance = 0\n", "\n", " self._input_resistance = level\n", " self._set_variable(\"mu_ex\", exc_conductance)\n", " self._set_variable(\"mu_in\", inhib_conductance)\n", "\n", " def set_noise(self, level):\n", " if level == self.HIGH or level == self.LOW:\n", " exc_noise = self.EXCITATORY_NOISE_VARIANCE[level]\n", " inhib_noise = self.INHIBITORY_NOISE_VARIANCE[level]\n", "\n", " else:\n", " exc_noise = inhib_noise = 0\n", "\n", " self._noise_level = level\n", " self._set_variable(\"sigma_ex\", exc_noise)\n", " self._set_variable(\"sigma_in\", inhib_noise)\n", "\n", " def set_injected_current(self, amplitude):\n", " self._set_variable(\"i_injected\", amplitude)\n", " self._set_variable(\"A\", 0 * pA)\n", "\n", " def set_stimulus_current(self, amplitude):\n", " self._set_variable(\"A\", amplitude)\n", " self._set_variable(\"i_injected\", 0 * pA)\n", "\n", " @property\n", " def f(self):\n", " return self.neurons.f\n", "\n", " @f.setter\n", " def f(self, new_f):\n", " self._set_variable(\"f\", new_f) # this will reset smon\n", " if self.stim_type == self.EXP2SYN:\n", " self.spiker.T = 1 / new_f\n", "\n", " def run(self, duration, report=\"stdout\"):\n", " self._duration = duration\n", " self.network.run(duration, report=report)\n", "\n", " def build_network(self):\n", " self.smon = StateMonitor(\n", " self.neurons, self.recorded_vars, record=True, name=\"smon\"\n", " )\n", " self.spikes = SpikeMonitor(self.neurons, name=\"spikes\")\n", "\n", " self.network = Network(self.neurons, self.smon, self.spikes)\n", "\n", " def _set_variable(self, name, value):\n", " self.neurons.__setattr__(name, value)\n", " self.reset_recording()\n", "\n", " def reset_recording(self):\n", " try:\n", " self.network\n", " except AttributeError:\n", " return # network not yet initialized\n", "\n", " self.network.remove(self.smon, self.spikes)\n", "\n", " self.smon = StateMonitor(\n", " self.neurons, self.recorded_vars, record=True, name=\"smon\"\n", " )\n", " self.spikes = SpikeMonitor(self.neurons, name=\"spikes\")\n", "\n", " self.network.add(self.smon, self.spikes)\n", "\n", " @property\n", " def spike_train(self):\n", " return self.spikes.spike_trains()\n", "\n", " @property\n", " def firing_rate(self):\n", " return self.spikes.count / self.duration\n", "\n", " @property\n", " def duration(self):\n", " return self._duration\n", "\n", " @property\n", " def input_resistance(self):\n", " if self._input_resistance == self.HIGH:\n", " return \"HIGH\"\n", " else:\n", " return \"LOW\"\n", "\n", " @property\n", " def noise_level(self):\n", " if self._noise_level == self.HIGH:\n", " return \"HIGH\"\n", " elif self._noise_level == self.LOW:\n", " return \"LOW\"\n", " else:\n", " return \"NO\"\n", "\n", " def __repr__(self):\n", " return f\"{self.neurons.N} Neurons with {self.input_resistance} input resistance and {self.noise_level} noise\"\n", "\n", " def __str__(self):\n", " return self.__repr__()\n", "\n", " def store(self, name):\n", " self.network.store(name)\n", "\n", " def restore(self, name):\n", " self.network.restore(name)\n", "\n", " @property\n", " def v(self):\n", " return self.smon.v\n", "\n", " @property\n", " def t(self):\n", " return self.smon.t\n", "\n", " @property\n", " def injected_current(self):\n", " return self.neurons.i_injected\n", "\n", " @property\n", " def stimulus_amplitude(self):\n", " return self.neurons.A\n", "\n", "\n", "class CurrentModel(Model):\n", " def __init__(self, **kwargs):\n", " super().__init__(stim=self.SINE, **kwargs)\n", "\n", " def create_model(self):\n", " model, parameters = super().create_model()\n", " model += CURRENT_INPUT\n", "\n", " return model, parameters\n", "\n", "\n", "class SineModel(CurrentModel):\n", " def create_model(self):\n", " model, parameters = super().create_model()\n", " model += SINE_INPUT\n", "\n", " return model, parameters\n", "\n", "\n", "class SawModel(CurrentModel):\n", " def create_model(self):\n", " model, parameters = super().create_model()\n", " model += SAW_INPUT\n", "\n", " return model, parameters\n", "\n", "\n", "class SynapticModel(Model):\n", " def __init__(self, **kwargs):\n", " super().__init__(stim=self.EXP2SYN, **kwargs)\n", "\n", " SYNAPTIC_PARAMETERS = {\n", " \"tau_input_1\": 0.4 * ms,\n", " \"tau_input_2\": 4 * ms,\n", " \"offset_A\": 1.48793507e-11,\n", " \"offset_B\": -2.66359562e-08,\n", " \"offset_C\": 1.77538800e-05,\n", " \"offset_D\": -8.05925810e-04,\n", " \"offset_E\": -3.51463644e-02,\n", " \"offset_switch\": 0,\n", " }\n", "\n", " def create_model(self):\n", " model, parameters = super().create_model()\n", " model += EXP2SYN_WAVEFORM + SUMMATION_OFFSET\n", " parameters = {**parameters, **self.SYNAPTIC_PARAMETERS}\n", "\n", " return model, parameters\n", "\n", " def build_network(self):\n", " super().build_network()\n", " self.spiker = NeuronGroup(\n", " self.neurons.N,\n", " \"\"\"T : second (constant)\n", " lastspike : second\"\"\",\n", " threshold=\"timestep(t-lastspike, dt)>=timestep(T, dt)\",\n", " reset=\"lastspike=t\",\n", " )\n", " self.spiker.T = 1 / self.neurons.f\n", " self.synapses = Synapses(\n", " self.spiker, self.neurons, on_pre=\"input_aux += 1\"\n", " ) # connect input to neurons\n", " self.synapses.connect(\"i==j\") # one synapse goes to one neuron\n", "\n", " self.network.add(self.spiker, self.synapses)\n", "\n", "\n", "class SynapticCurrentModel(SynapticModel):\n", " def __init__(self, offset=True, **kwargs):\n", " self.offset = 1 if offset else 0\n", " super().__init__(**kwargs)\n", "\n", " def create_model(self):\n", " model, parameters = super().create_model()\n", " model += CURRENT_INPUT + SYNAPTIC_INPUT_CURRENT\n", " parameters = {**parameters, **{\"offset_switch\": self.offset}}\n", "\n", " return model, parameters\n", "\n", "\n", "class SynapticConductanceModel(SynapticModel):\n", " FLAT = 0\n", " ACTIVE = 1\n", "\n", " CONDUCTANCE_PARAMETERS = {\n", " \"A\": 0 * nS, # overwrite A to be conductance\n", " \"g_i\": 1 * nS,\n", " }\n", "\n", " INHIBITION_PARAMETERS = {\n", " \"tau_inhibition_1\": 1 * ms,\n", " \"tau_inhibition_2\": 10 * ms,\n", " }\n", "\n", " def __init__(self, offset=ACTIVE, **kwargs):\n", " self.offset = offset\n", " super().__init__(**kwargs)\n", "\n", " def create_model(self):\n", " model, parameters = super().create_model()\n", " if self.offset == self.FLAT:\n", " model += CONDUCTANCE_INPUT + SYNAPTIC_CONDUCTANCE_FLAT\n", " parameters = {\n", " **parameters,\n", " **self.SYNAPTIC_PARAMETERS,\n", " **self.CONDUCTANCE_PARAMETERS,\n", " **{\"offset_switch\": 1},\n", " }\n", "\n", " elif self.offset == self.ACTIVE:\n", " model += CONDUCTANCE_INPUT + SYNAPTIC_CONDUCTANCE_STIM\n", " parameters = {\n", " **parameters,\n", " **self.SYNAPTIC_PARAMETERS,\n", " **self.CONDUCTANCE_PARAMETERS,\n", " **self.INHIBITION_PARAMETERS,\n", " }\n", "\n", " return model, parameters\n", "\n", " def build_network(self):\n", " super().build_network()\n", " if self.offset != self.ACTIVE:\n", " return\n", "\n", " self.inhib_synapses = Synapses(\n", " self.spiker, self.neurons, on_pre=\"input_inhib_aux += 1\", delay=2 * ms\n", " ) # connect input to neurons\n", " self.inhib_synapses.connect(\"i==j\") # one synapse goes to one neuron\n", "\n", " self.network.add(self.inhib_synapses)" ] }, { "cell_type": "code", "execution_count": 2, "id": "c82769f2", "metadata": { "scrolled": false }, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "WARNING Cannot use Cython, a test compilation failed: Microsoft Visual C++ 14.0 or greater is required. Get it with \"Microsoft C++ Build Tools\": https://visualstudio.microsoft.com/visual-cpp-build-tools/ (DistutilsPlatformError) [brian2.codegen.runtime.cython_rt.cython_rt.failed_compile_test]\n", "INFO Cannot use compiled code, falling back to the numpy code generation target. Note that this will likely be slower than using compiled code. Set the code generation to numpy manually to avoid this message:\n", "prefs.codegen.target = \"numpy\" [brian2.devices.device.codegen_fallback]\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Starting simulation at t=0. s for a duration of 12. s\n", "0.57797 s (4%) simulated in 10s, estimated 3m 18s remaining.\n", "1.15458 s (9%) simulated in 20s, estimated 3m 8s remaining.\n", "1.7348 s (14%) simulated in 30s, estimated 2m 58s remaining.\n", "2.30077 s (19%) simulated in 40s, estimated 2m 49s remaining.\n", "2.8383 s (23%) simulated in 50s, estimated 2m 41s remaining.\n", "3.37323 s (28%) simulated in 1m 0s, estimated 2m 33s remaining.\n", "3.80617 s (31%) simulated in 1m 10s, estimated 2m 31s remaining.\n", "4.3266 s (36%) simulated in 1m 20s, estimated 2m 22s remaining.\n", "4.81076 s (40%) simulated in 1m 30s, estimated 2m 15s remaining.\n", "5.34558 s (44%) simulated in 1m 40s, estimated 2m 5s remaining.\n", "5.88416 s (49%) simulated in 1m 50s, estimated 1m 54s remaining.\n", "6.42113 s (53%) simulated in 2m 0s, estimated 1m 44s remaining.\n", "6.95157 s (57%) simulated in 2m 10s, estimated 1m 34s remaining.\n", "7.47731 s (62%) simulated in 2m 20s, estimated 1m 25s remaining.\n", "8.01432 s (66%) simulated in 2m 30s, estimated 1m 15s remaining.\n", "8.55137 s (71%) simulated in 2m 40s, estimated 1m 5s remaining.\n", "9.08927 s (75%) simulated in 2m 50s, estimated 54s remaining.\n", "9.60162 s (80%) simulated in 3m 0s, estimated 45s remaining.\n", "10.10329 s (84%) simulated in 3m 10s, estimated 36s remaining.\n", "10.61838 s (88%) simulated in 3m 20s, estimated 26s remaining.\n", "11.1533 s (92%) simulated in 3m 30s, estimated 16s remaining.\n", "11.65781 s (97%) simulated in 3m 40s, estimated 6s remaining.\n", "12. s (100%) simulated in 3m 46s\n" ] }, { "data": { "text/plain": [ "[<matplotlib.collections.EventCollection at 0x231816a6af0>,\n", " <matplotlib.collections.EventCollection at 0x231816b8df0>,\n", " <matplotlib.collections.EventCollection at 0x231816c31c0>,\n", " <matplotlib.collections.EventCollection at 0x231816ca520>,\n", " <matplotlib.collections.EventCollection at 0x231816d27c0>,\n", " <matplotlib.collections.EventCollection at 0x231816d99d0>,\n", " <matplotlib.collections.EventCollection at 0x231816e1c10>,\n", " <matplotlib.collections.EventCollection at 0x231816e7fd0>,\n", " <matplotlib.collections.EventCollection at 0x231816f3370>,\n", " <matplotlib.collections.EventCollection at 0x231816fc580>,\n", " <matplotlib.collections.EventCollection at 0x231817037f0>,\n", " <matplotlib.collections.EventCollection at 0x231817099a0>,\n", " <matplotlib.collections.EventCollection at 0x23181711d60>,\n", " <matplotlib.collections.EventCollection at 0x2318171e190>,\n", " <matplotlib.collections.EventCollection at 0x231817254f0>,\n", " <matplotlib.collections.EventCollection at 0x2318172c4f0>,\n", " <matplotlib.collections.EventCollection at 0x23181732940>,\n", " <matplotlib.collections.EventCollection at 0x2318173cbb0>,\n", " <matplotlib.collections.EventCollection at 0x23181743e50>,\n", " <matplotlib.collections.EventCollection at 0x2318174d220>,\n", " <matplotlib.collections.EventCollection at 0x23181755640>,\n", " <matplotlib.collections.EventCollection at 0x2318175e9a0>,\n", " <matplotlib.collections.EventCollection at 0x23181765be0>,\n", " <matplotlib.collections.EventCollection at 0x2318176ce50>,\n", " <matplotlib.collections.EventCollection at 0x23181778100>,\n", " <matplotlib.collections.EventCollection at 0x231817803d0>,\n", " <matplotlib.collections.EventCollection at 0x23181787580>,\n", " <matplotlib.collections.EventCollection at 0x2318178e880>,\n", " <matplotlib.collections.EventCollection at 0x23181794a00>,\n", " <matplotlib.collections.EventCollection at 0x2318179dcd0>,\n", " <matplotlib.collections.EventCollection at 0x231817a4fa0>,\n", " <matplotlib.collections.EventCollection at 0x231817b13a0>,\n", " <matplotlib.collections.EventCollection at 0x231817b6790>,\n", " <matplotlib.collections.EventCollection at 0x231817bfa90>,\n", " <matplotlib.collections.EventCollection at 0x231817c7dc0>,\n", " <matplotlib.collections.EventCollection at 0x231817d2160>,\n", " <matplotlib.collections.EventCollection at 0x231817d93d0>,\n", " <matplotlib.collections.EventCollection at 0x231817e26d0>,\n", " <matplotlib.collections.EventCollection at 0x231817e9a90>,\n", " <matplotlib.collections.EventCollection at 0x231817f0b80>,\n", " <matplotlib.collections.EventCollection at 0x231817f7e50>,\n", " <matplotlib.collections.EventCollection at 0x231817ffe50>,\n", " <matplotlib.collections.EventCollection at 0x2318180b1f0>,\n", " <matplotlib.collections.EventCollection at 0x23181812460>,\n", " <matplotlib.collections.EventCollection at 0x2318181a610>,\n", " <matplotlib.collections.EventCollection at 0x23181820a00>,\n", " <matplotlib.collections.EventCollection at 0x23181827df0>,\n", " <matplotlib.collections.EventCollection at 0x23181834220>,\n", " <matplotlib.collections.EventCollection at 0x2318183b670>,\n", " <matplotlib.collections.EventCollection at 0x23181843a00>]" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXEAAAD4CAYAAAAaT9YAAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuNCwgaHR0cHM6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83dT6dxCBDAMAqgPu6undhjgs0BZ+uxk8WNpv0A8BzAax31+VfAexo2Je3AHios+OfMMt4aMIXAB/ETMv/IWb/07xpStsBnAfgXwA8jFnWx7MX7MvDmOnY/Xf/3Yv0hY/dE0JIw2x1OYUQQkgGBnFCCGkYBnFCCGkYBnFCCGkYBnFCCGkYBnFCCGkYBnFCCGmY/wOdJ9N3Tr7UUgAAAABJRU5ErkJggg==\n", "text/plain": [ "<Figure size 432x288 with 1 Axes>" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "#from models import Model, SynapticConductanceModel\n", "from brian2 import *\n", "import numpy as np\n", "import matplotlib.pyplot as plt\n", "\n", "\n", "model = SynapticConductanceModel(resistance=Model.LOW, # Model.LOW, Model.HIGH\n", " noise=Model.LOW, n=50, # Model.OFF, Model.LOW, Model,HIGH\n", " offset=SynapticConductanceModel.ACTIVE)\n", "\n", "\n", "# model = SineModel(resistance=Model.LOW, # Model.LOW, Model.HIGH\n", "# noise=Model.OFF, n=1, # Model.OFF, Model.LOW, Model,HIGH\n", "# )\n", "\n", "\n", "model.f = 100 * Hz\n", "model.set_stimulus_current(400 * nS) # current should be scaled by 100x for Active Offset so (500nS is actually 5nS)\n", "model._set_variable(\"i_injected\", 65 * pA)\n", "\n", "\n", "model.run(12*second)\n", "\n", "spike_times = [s/ms for s in model.spike_train.values()]\n", "\n", "plt.eventplot(spike_times)\n" ] }, { "cell_type": "code", "execution_count": 3, "id": "7f22e21e", "metadata": {}, "outputs": [], "source": [ "#print(spike_times)" ] }, { "cell_type": "code", "execution_count": 4, "id": "20e3191c", "metadata": {}, "outputs": [], "source": [ "import scipy.io\n", "import numpy as np\n", "\n", "\n", "file_path = 'data0.mat'\n", "scipy.io.savemat(file_path, {'data0': spike_times[0]})\n", "\n", "file_path = 'data1.mat'\n", "scipy.io.savemat(file_path, {'data1': spike_times[1]})\n", "\n", "file_path = 'data2.mat'\n", "scipy.io.savemat(file_path, {'data2': spike_times[2]})\n", "\n", "file_path = 'data3.mat'\n", "scipy.io.savemat(file_path, {'data3': spike_times[3]})\n", "\n", "file_path = 'data4.mat'\n", "scipy.io.savemat(file_path, {'data4': spike_times[4]})\n", "\n", "file_path = 'data5.mat'\n", "scipy.io.savemat(file_path, {'data5': spike_times[5]})\n", "\n", "file_path = 'data6.mat'\n", "scipy.io.savemat(file_path, {'data6': spike_times[6]})\n", "\n", "file_path = 'data7.mat'\n", "scipy.io.savemat(file_path, {'data7': spike_times[7]})\n", "\n", "file_path = 'data8.mat'\n", "scipy.io.savemat(file_path, {'data8': spike_times[8]})\n", "\n", "file_path = 'data9.mat'\n", "scipy.io.savemat(file_path, {'data9': spike_times[9]})\n", "\n", "file_path = 'data10.mat'\n", "scipy.io.savemat(file_path, {'data10': spike_times[10]})\n", "\n", "file_path = 'data11.mat'\n", "scipy.io.savemat(file_path, {'data11': spike_times[11]})\n", "\n", "file_path = 'data12.mat'\n", "scipy.io.savemat(file_path, {'data12': spike_times[12]})\n", "\n", "file_path = 'data13.mat'\n", "scipy.io.savemat(file_path, {'data13': spike_times[13]})\n", "\n", "file_path = 'data14.mat'\n", "scipy.io.savemat(file_path, {'data14': spike_times[14]})\n", "\n", "file_path = 'data15.mat'\n", "scipy.io.savemat(file_path, {'data15': spike_times[15]})\n", "\n", "file_path = 'data16.mat'\n", "scipy.io.savemat(file_path, {'data16': spike_times[16]})\n", "\n", "file_path = 'data17.mat'\n", "scipy.io.savemat(file_path, {'data17': spike_times[17]})\n", "\n", "file_path = 'data18.mat'\n", "scipy.io.savemat(file_path, {'data18': spike_times[18]})\n", "\n", "file_path = 'data19.mat'\n", "scipy.io.savemat(file_path, {'data19': spike_times[19]})\n", "\n", "file_path = 'data20.mat'\n", "scipy.io.savemat(file_path, {'data20': spike_times[20]})\n", "\n", "file_path = 'data21.mat'\n", "scipy.io.savemat(file_path, {'data21': spike_times[21]})\n", "\n", "file_path = 'data22.mat'\n", "scipy.io.savemat(file_path, {'data22': spike_times[22]})\n", "\n", "file_path = 'data23.mat'\n", "scipy.io.savemat(file_path, {'data23': spike_times[23]})\n", "\n", "file_path = 'data24.mat'\n", "scipy.io.savemat(file_path, {'data24': spike_times[24]})\n", "\n", "file_path = 'data25.mat'\n", "scipy.io.savemat(file_path, {'data25': spike_times[25]})\n", "\n", "file_path = 'data26.mat'\n", "scipy.io.savemat(file_path, {'data26': spike_times[26]})\n", "\n", "file_path = 'data27.mat'\n", "scipy.io.savemat(file_path, {'data27': spike_times[27]})\n", "\n", "file_path = 'data28.mat'\n", "scipy.io.savemat(file_path, {'data28': spike_times[28]})\n", "\n", "file_path = 'data29.mat'\n", "scipy.io.savemat(file_path, {'data29': spike_times[29]})\n", "\n", "file_path = 'data30.mat'\n", "scipy.io.savemat(file_path, {'data30': spike_times[30]})\n", "\n", "file_path = 'data31.mat'\n", "scipy.io.savemat(file_path, {'data31': spike_times[31]})\n", "\n", "file_path = 'data32.mat'\n", "scipy.io.savemat(file_path, {'data32': spike_times[32]})\n", "\n", "file_path = 'data33.mat'\n", "scipy.io.savemat(file_path, {'data33': spike_times[33]})\n", "\n", "file_path = 'data34.mat'\n", "scipy.io.savemat(file_path, {'data34': spike_times[34]})\n", "\n", "file_path = 'data35.mat'\n", "scipy.io.savemat(file_path, {'data35': spike_times[35]})\n", "\n", "file_path = 'data36.mat'\n", "scipy.io.savemat(file_path, {'data36': spike_times[36]})\n", "\n", "file_path = 'data37.mat'\n", "scipy.io.savemat(file_path, {'data37': spike_times[37]})\n", "\n", "file_path = 'data38.mat'\n", "scipy.io.savemat(file_path, {'data38': spike_times[38]})\n", "\n", "file_path = 'data39.mat'\n", "scipy.io.savemat(file_path, {'data39': spike_times[39]})\n", "\n", "file_path = 'data40.mat'\n", "scipy.io.savemat(file_path, {'data40': spike_times[40]})\n", "\n", "file_path = 'data41.mat'\n", "scipy.io.savemat(file_path, {'data41': spike_times[41]})\n", "\n", "file_path = 'data42.mat'\n", "scipy.io.savemat(file_path, {'data42': spike_times[42]})\n", "\n", "file_path = 'data43.mat'\n", "scipy.io.savemat(file_path, {'data43': spike_times[43]})\n", "\n", "file_path = 'data44.mat'\n", "scipy.io.savemat(file_path, {'data44': spike_times[44]})\n", "\n", "file_path = 'data45.mat'\n", "scipy.io.savemat(file_path, {'data45': spike_times[45]})\n", "\n", "file_path = 'data46.mat'\n", "scipy.io.savemat(file_path, {'data46': spike_times[46]})\n", "\n", "file_path = 'data47.mat'\n", "scipy.io.savemat(file_path, {'data47': spike_times[47]})\n", "\n", "file_path = 'data48.mat'\n", "scipy.io.savemat(file_path, {'data48': spike_times[48]})\n", "\n", "file_path = 'data49.mat'\n", "scipy.io.savemat(file_path, {'data49': spike_times[49]})\n", "\n", "\n", "\n" ] }, { "cell_type": "code", "execution_count": null, "id": "d353eff4", "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.8.8" } }, "nbformat": 4, "nbformat_minor": 5 }