embedded matlab function

2 次查看(过去 30 天)
Ngan Shan
Ngan Shan 2011-12-22
I'm using embedded matlab function for my project. How to initialize the parameter just once at the beginning? some sort like this: j = 0 (initialize once only) j=j+1 (the value of j is updated after every loop running)

回答(1 个)

Rick Rosson
Rick Rosson 2011-12-22
Please try:
persistent j
if isempty(j)
j = 0;
end
j = j + 1;
HTH.
Rick

类别

Help CenterFile Exchange 中查找有关 MATLAB Coder 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by