[Solved] Iterating through a matrix with same vector in C [closed]


OK, so assuming you want to store the results in c, with dims 256, 50, do something like:

for(int i = 0; i < 256; ++i)
    for(int j = 0; j < 55; ++j)
    {
        c[i][j] = compute_correlation(matrixA, i, matrixB, j);
    }

with compute_correlation a simple for loop that will compute the value according to the formal:

double compute_correlation(double matrixA[600][256], i, double matrixB[600][55], j)
{
    for(int k = 0; k < 600; ++k)
    {
      // Compute means of both rows
    }
    for(int k = 0; k < 600; ++k)
    {
      // Compute numerator
      // Compute denominator
    }
    return numerator / denominator;
}

10

solved Iterating through a matrix with same vector in C [closed]