Traitement-signal-plantes/Code-C/growthRate.c
2022-06-16 17:05:12 +02:00

36 lines
1 KiB
C

#include "initialParameters.h"
#include "fileGestion.h"
#include "getArray.h"
#include "growthRate.h"
/**
* @brief calculate de growth rate between to point next to each other
*
* @param dataArray array with data of points next to each other for each captor (dim : 2 * nCols)
* @param gRateArray array that contaigns results of the growth ratecalculation
*/
void growthRateCalculation(double **dataArray , double *gRateArray){
for(int i = 0 ; i < nCol-1 ; i++){
gRateArray[i] = (dataArray[0][i] - dataArray[1][i]) / period;
}
}
/**
* @brief calcul then print differentiate in csv
*
* @param dataLign
*/
void growthRateFunction(double **dataLign , char* fileName){
double gRateArray[nCol-1];
growthRateCalculation(dataLign , gRateArray);
appendDataInFile(fileName,gRateArray , nCol-1);
}
void sumColArray(long **p, double res[] , int N , int M){
for(int i = 1; i < M; i++){
int j = 0;
res[i] = 0;
while(j < N){
res[i] += p[i][j];
j++;
}
}
}