I have this part of my code, and I was wondering if this way of implementation is right.
flag=flag & PE(n,1)>p_fix
if count1==5*N && flag
fprintf('Accuses IC\n')
elseif count1==5*N
fprintf('Does not accuse IC\n')
Basically, I wanted the else condition to happen only when count1==5*N and the flag condition was not respected. In this way I did it analyze for the condition I mentioned?

 채택된 답변

Stephen23
Stephen23 2022년 1월 7일
편집: Stephen23 2022년 1월 7일

1 개 추천

" I wanted the else condition to happen only when count1==5*N and the flag condition was not respected."
Make the code explicit:
if count1==5*N
if flag
fprintf('Accuses IC\n')
else
fprintf('Does not accuse IC\n')
end
end

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Programming에 대해 자세히 알아보기

태그

질문:

2022년 1월 7일

댓글:

2022년 1월 7일

Community Treasure Hunt

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

Start Hunting!

Translated by