How to Fix Error "The extrinsic function 'toc' is not available for standalone code generation."
显示 更早的评论
The extrinsic function 'toc' is not available for standalone code generation. It must be eliminated for stand-alone code to be generated. It could not be eliminated because its outputs appear to influence the calling function. Fix this error by not using 'toc' or by ensuring that its outputs are unused.
Find below code
function y = fcn
%#codegen
persistent temp;
coder.extrinsic('tic')
if isempty(temp)
tic;
temp = 0;
end
coder.extrinsic('toc')
temp = toc;
y = temp;
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Function Definition 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!