String formatting / manipulation in combination with Matlab Coder
1 回表示 (過去 30 日間)
古いコメントを表示
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 件のコメント
回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!