power debug (column = 0)
This commit is contained in:
parent
479289a365
commit
efc3110b2d
BIN
Code-C/main
BIN
Code-C/main
Binary file not shown.
|
@ -9,7 +9,7 @@
|
||||||
#include "getArray.h"
|
#include "getArray.h"
|
||||||
|
|
||||||
bool rawDataWriteFlag;
|
bool rawDataWriteFlag;
|
||||||
int nRow = 4;
|
int nRow = 500;
|
||||||
int nCol = 1;
|
int nCol = 1;
|
||||||
double freqEch = 250;
|
double freqEch = 250;
|
||||||
|
|
||||||
|
|
|
@ -11,15 +11,14 @@
|
||||||
* @param powerArray array where results are stocked
|
* @param powerArray array where results are stocked
|
||||||
*/
|
*/
|
||||||
void powerCalculation(long **p, double powerArray[]){
|
void powerCalculation(long **p, double powerArray[]){
|
||||||
printArrayData(p,nRow,nCol);
|
|
||||||
printf("data in pw : \n");
|
printf("data in pw : \n");
|
||||||
for(int i = 1; i < nCol; i++){
|
for(int i = 0; i < nCol; i++){
|
||||||
int j = 0;
|
int j = 0;
|
||||||
powerArray[i] = 0;
|
powerArray[i] = 0;
|
||||||
|
|
||||||
while(j < nRow){
|
while(j < nRow){
|
||||||
printf("%d , %d , %d , %d\n" , p[j][i] ,powerArray[i] , i ,j);
|
printf("\np[%d,%d] = %d\npwArray[%d] = %lf\n" , j,i,p[j][i+1],i,powerArray[i]);
|
||||||
powerArray[i] + pow(p[j][i],2);
|
powerArray[i] += pow(p[j][i+1],2);
|
||||||
j++;
|
j++;
|
||||||
}
|
}
|
||||||
powerArray[i] /= nRow;
|
powerArray[i] /= nRow;
|
||||||
|
|
Loading…
Reference in a new issue