Hi,
I have faced a problem with the matlab compiled code which I have beemn
able
to debug but still I am not able to understand the wierd behavior.
I had a code like the following
var = scalar * (x + i*y).';
where x and y are matrix of same size and "scalar" is a scalar constant.
This code is in a function which is called in a loop.
On compilig this code code when I run the executable it creates a memory
leakage and the executable crashes due to memory allocation issue.
Then I modifies it to
var = scalar .* (x + i*y).';
With this the memory problem with the executable got solved.
Then I looked into the generated c file corresponding to this code
var = scalar * (x + i*y).';
mlfAssign(
&var,
mlf_times_transpose(
mclVv(scalar, "scalar"),
mclPlus(
mclVv(x, "x"),
mclMtimes(_mxarray14_, mclVv(y, "y"))),
_mxarray1_));
var = scalar .* (x + i*y).';
mlfAssign(
&var,
mclTimes(
mclVv(scalar, "scalar"),
mlfTranspose(
mclPlus(
mclVv(x, "x"),
mclMtimes(_mxarray14_, mclVv(y, "y"))))));
Any idea on this wierd bahavior of the compiled code.
Regards,
Amit