Filter löschen
Filter löschen

String formatting / manipulation in combination with Matlab Coder

2 Ansichten (letzte 30 Tage)
Joost
Joost am 7 Sep. 2016
Matlab Coder is used in a project to generate C code from an algorithm designed in Matlab. Comprehensive messages are constructed in the algorithm to provide meaningful feedback as output of the primary function (entry-point function). I know that sprintf is not supported by the Coder toolbox. Is there a different way to construct/concatenate/manipulate strings in Matlab that is supported by the Coder?
What I (for example) would like to do: (abstracted code here)
[resultValue, outputMessage] = functionName(inputArgument)
% Some calculations here that set the resultValue.
% The number of iterations used to get to the end result is also calculated.
outputMessage = sprintf('%d iterations were used.', numberOfIterations);
end
The output string can of course be much more complex, or a concatenation of several messages that occurred during the execution of the algorithm.

Antworten (0)

Kategorien

Mehr zu MATLAB Coder finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by