Here's a solution that works now, with any version of NEURON. And it has two advantages over copy & paste: it doesn't limit you to simple "one-liner" functions, and it allows you to easily test your function to make sure it's working properly. Create a new hoc file, and put inside it a single function that takes one argument. The body of the function can be anything you like. Then xopen() your hoc file, and when you configure the MRF, you can just enter the name of the function.
Example: suppose you want to adjust the parameters of a biexponential function so that the function matches an experimentally recorded waveform. You could just click on
Fitness / Expression with $1
and then type
A*(exp(-k1*$1) - (exp(-k2*$1))
into the tool that requests the "Expresssion involving the independent variable, $1".
But my suggestion would have you do this:
1. Use a text editor to create this function definition:
- Code: Select all
func biexp() {
return A*(exp(-k1*$1) - exp(-k2*$1))
}
and save it to a file called myfunc.hoc.
2. At the oc> prompt type xopen("myfunc.hoc"). Now hoc knows a new function called biexp().
3. After clicking on
Fitness / Expression with $1
just type
biexp($1)
into the tool that requests the "Expresssion involving the independent variable, $1".