String formatting / manipulation in combination with Matlab Coder

4 ビュー (過去 30 日間)
Joost
Joost 2016 年 9 月 7 日
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.

回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB Coder についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by