clear persistent in function simulink

조회 수: 4 (최근 30일)
Mohammad alshamaa
Mohammad alshamaa 2020년 5월 14일
hallo,
i need to clear persistent in simulink function when ytyt==15 but it say this:
Function 'clear' is not supported for code generation and the coder.extrinsic directive cannot be applied to 'clear'. Rewrite your code so it does not use 'clear'.
so how i can do it ?
function y = fcn(u)
persistent ytyt;
if isempty(ytyt)
ytyt=u
end
ytyt=ytyt+1
if ytyt == 15
clear ytyt
end
y = ytyt
end

답변 (0개)

카테고리

Help CenterFile Exchange에서 Simulink Functions에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by