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

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