summaryrefslogtreecommitdiffstats
path: root/scilab_doc/toolbox_guide/toolbox_example/src/fun1.c
blob: ce919662b79dbe65e8bcc4016118d9b452d908fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
extern void  fun2(double *, int, int *);

void fun1(double * a,  int na, int * nx,  double ** x , double * y){
        int i, k1=0;
        *y=0;
        fun2(a, na, nx);
        *x=(double *)malloc((*nx)*sizeof(double));
        *y=0;
        for(i=0;i<na;i++)
        if(a[i]>0) {
                *(*x+k1)=a[i];
                *y += a[i];
                k1++;
        };
}