1

I've a MATLAB function which computes a histogram difference between two color histograms. I've converted it into a corresponding JAR file using MATLAB Builder.

Now, when I try to retrieve the value, it's giving some unexpected results. The same code when executed in MATLAB for the same arguments is giving a different answer than that given when using Java.

The difference between both answers is quite large, so, it cannot be neglected.

Code is at: https://gist.github.com/835910

Can any one tell me the reason why this is happening?

Amro
  • 123,847
  • 25
  • 243
  • 454
Mahesh Gupta
  • 2,688
  • 9
  • 30
  • 46

1 Answers1

0

The only thing that immediately jumps out at me is that you're returning a matrix. And in Java, matrices are stored row-major but in Matlab they are stored column major.

So: is the data your sending to Matlab column major compatible? And are you interpreting the answer (hist) as column major?

This is a bit of a shot in the dark...

Chris
  • 1,532
  • 10
  • 19