MATLAB: Is it possible to to use the method mwArray::SetData in MATLAB Compiler 4.10 (R2009a) with a constant as the first argument

MATLAB Compilermxarray

I want to pass a variable to mwArray::SetData declared as cont. However, it is not possible mwArray::SetData has no signature with first argument as const.

Best Answer

The ability to pass constant variables to mwArray::SetData is not available in MATLAB Compliler 4.10 (R2009a).
To work around this issue typecast the variable before passing it to mwArray::SetData to ensure that it is not a constant.