All pastes #70087 Raw Edit

Stuff

public text v1 · immutable
#70087 ·published 2006-06-23 19:25 UTC
rendered paste body
#include <stdio.h>
#include <pthread.h>
#include <stdlib.h>
#include <math.h>

int main(int argc, char *argv[])
{
    int neurons = 50;
    int maxspikes;
    //int totalbins;

    double iapp, epsilon, stepsize, windowsize, starttime, endtime, timelength;
    double itotal, fastfreq, periodms, window, halfwindow, leftshift;

    iapp = 3.0;
    epsilon = 0.08586;


    stepsize = 0.01;
    windowsize = 0.2;

    starttime = 7000.0;
    endtime = 8000.0;


    timelength = endtime - starttime;

    //totalbins = 2;
    //totalbins = (int)(timelength / stepsize);

    itotal = iapp + epsilon;

    fastfreq = -0.112*pow(itotal,4) + 1.88*pow(itotal,3) - 13.1*pow(itotal,2) + 70.5*itotal + 0.258;

    periodms = 1000 / fastfreq;

    window = windowsize * periodms;
    halfwindow = 0.5 * window;
    leftshift = ceil(halfwindow/stepsize);

    FILE *fopen(), *vraster[neurons];

    maxspikes = (int)ceil((timelength/periodms) * 2);
    printf("%d\n", maxspikes);
    double spiketrain[neurons][maxspikes];

    int i;
    for (i = 1; i <= neurons; i++)
    {
        char *filename;
        sprintf(filename, "%dvoltage_raster.out", i);
        printf("%d %s\n", i, filename);
        vraster[i-1] = fopen(filename, "r");

        int j = 0;
        int k;
        while (fscanf(vraster[i-1], "%lf   %d", &spiketrain[i-1][j], &k) == 2)
        {
            j++;
        }
    }

    return 0;
}