필터 지우기
필터 지우기

Matlab code problem in a S-function

조회 수: 1 (최근 30일)
alessandro
alessandro 2014년 6월 29일
댓글: Image Analyst 2014년 6월 29일
Hi, I have this loop in my code:
global counter
T=200
if counter>=T
counter=0
.
.
else counter=counter+1
end
This code worked fine yesterday and now no, but I have not changed anything. Until yesterday, the answer was
counter =
1
.
.
counter =
200
and now:
counter =
[]
.
.
counter =
[]
Please help me

채택된 답변

Image Analyst
Image Analyst 2014년 6월 29일
When you enter the routine counter is null for some reason. Probably some other part of your code did it. Change the line
if counter>=T
to this
if isempty(counter) || counter >= T
That should make it not null anymore.
  댓글 수: 2
alessandro
alessandro 2014년 6월 29일
perfect, it works. Thank you
Image Analyst
Image Analyst 2014년 6월 29일
Can you mark the Answer as "Accepted" then? Thanks.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by