-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreadnetwork.m
More file actions
28 lines (27 loc) · 1.02 KB
/
readnetwork.m
File metadata and controls
28 lines (27 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
function [n_arcs, nettable] = readnetwork(filename)
% readnetwork reads a network (or set of weights) from the file filename
% Either:
%% reads network into a table. Ntwork is expected to have
% from_ntype from_nno to_ntype to_nno to_syntype to_synno delay
% as first line, where
% (arc source,axon)
% from_ntype is X (input), TPN or II, from_nno is number of this neuron
% (arc target, synapse)
% to_ntype is TPN or II
% to_nno is number of target neuron
% to_syntype is synapse type: s for simple (II), A for apical, B for basal,
% AS for apical shunt, BS for basal shunt
% to_synno is synapse number of this type
% delay is delay of this arc in seconds
% or
%% reads weight table in, returning the number of weights and the weight
% table
% 1st line is neuron_type neuron_number syn_type syn_number weight
%
% LSS 21 October 2024.
% updated 3 Sept 2025.
opts = detectImportOptions(filename);
opts.DataLines = 2; % start data at line 2
nettable = readtable(filename, opts) ;
n_arcs = height(nettable) ; % number of arcs
end