How to read multiple data values into an array
Posted: Mon Feb 18, 2019 11:46 am
I am rather new to the hoc programming language, and I was wondering how I can assign a list of values to an array all in one go. For example, I want to assign various neuron lengths to a variable length_neuron, so I think I want something like this:
double length_neuron[3]
length_neuron = {40, 56, 64, 70}
So that the array length_neuron contains the values 40, 56, 64, 70. However, I don't know what the appropriate syntax is for this (as you can almost certainly tell).
Is it possible to do this with just two lines of code, or is it necessary to create a loop to assign each element individually? The latter seems a rather clumsy solution.
double length_neuron[3]
length_neuron = {40, 56, 64, 70}
So that the array length_neuron contains the values 40, 56, 64, 70. However, I don't know what the appropriate syntax is for this (as you can almost certainly tell).
Is it possible to do this with just two lines of code, or is it necessary to create a loop to assign each element individually? The latter seems a rather clumsy solution.