Archived

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

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

This topic is 5724 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

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

Share on other sites
Let me get this straight. You''re trying to square one array item from a 2d array minus another item in the 2d array, or all of the items in two sepeterate arrays or what?

Share on other sites
getting the sqaure of the difference

Share on other sites
getting the sqaure of the difference

Share on other sites
square of the difference I understand. Of the entire 2d array, or two seperate 2d arrays of the same size or what?

Share on other sites
2 separate 2d array of the same size

Share on other sites
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 on other sites
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

1. 1
2. 2
Rutin
21
3. 3
4. 4
frob
17
5. 5
• Forum Statistics

• Total Topics
632595
• Total Posts
3007266

×