/* See {nmsim_test.h} */ /* Last edited on 2017-08-04 11:48:05 by jstolfi */ #define _GNU_SOURCE #include #include #include #include #include #include #include #include void nmsim_test_plot_firing_func(char *prefix, nmsim_neuron_parms_t *parms) { char *fname = jsprintf("%s-Phi.txt", prefix); FILE *wr = open_write(fname, TRUE); double V_min = -100.0; /* Min {V} for plot (mV). */ double V_max = +20.0; /* Max {V} for plot (mV). */ int32_t NS = 2400; /* Number of plotting steps. */ for (int32_t i = 0; i <= NS; i++) { double s = ((double)i)/((double)NS); double V = (1 - s)*V_min + s*V_max; double pr, dpr; nmsim_firing_func_eval(parms->Phi, V, &pr, &dpr); fprintf(wr, "%+8.3f %8.6f %9.6f\n", V, pr, dpr); } fclose(wr); free(fname); }