Archived

This topic is now archived and is closed to further replies.

BLurnewbie

How to write (square[Array()() - Array2()()]) as code?

Recommended Posts

Ok, easy enough. We''ll say the arrays are 10x10, but they could be anything.

  
#include <math.h>

int arr1[10][10], arr2[10][10], int result;

// set the values somewhere to whatever


// I don''t know if you want to keep the values and add up a

// result or what, so I''ll just make a new result every time.


for(int i = 0; i < 10; i++)
for(int j = 0; j < 10; j++)
result = sqrt(arr1[i][j] - arr2[i][j]);


If you specify more what you need, I''d be happy to help.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
I am trying to load a series of image files and compare it with an image file. After comparing, i should like to display the image file with the least square of difference (error)...

thanks

Share this post


Link to post
Share on other sites