MATLAB Language C++ compatible helper functions


Example

The use of Matlab Coder sometimes denies the use of some very common functions, if they are not compatible to C++. Relatively often there exist undocumented helper functions, which can be used as replacements.

Here is a comprehensive list of supported functions..

And following a collection of alternatives, for non-supported functions:


The functions sprintf and sprintfc are quite similar, the former returns a character array, the latter a cell string:

 str = sprintf('%i',x)   % returns '5' for x = 5
 str = sprintfc('%i',x)  % returns {'5'} for x = 5

However, sprintfc is compatible with C++ supported by Matlab Coder, and sprintf is not.