MATLAB: Does the matrixdriver.c example for MATLAB Compiler 4.0 (R14) display the matrix incorrectly

compilerexampleMATLAB Compilermatrixdrivertransposed;

When I run the example, it appears to have transposed the matrix. Is this correct?

Best Answer

This bug has been fixed for Release 14 SP1 (R14SP1). For previous releases, please read below for any possible workarounds:
We have verified that there is a bug in MATLAB Compiler 4.0 (R14) in the way that the display function is written in the matrixdriver.c example. To work around this issue, change the display function. We display as row major, but MATLAB is column major.
The line:
printf("%4.2f\t",data[i*c+j]);
Should be:
printf("%4.2f\t",data[j*c+i]);
Swapping i and j corrects the output.