필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

problem with if test to test the increment in time

조회 수: 1 (최근 30일)
chikha said
chikha said 2014년 5월 25일
마감: MATLAB Answer Bot 2021년 8월 20일
salut svp il y a un probleme sur mon programe: je veux fait un test sur le temps, si le temp egale la période (1*T,2*T,...,n*T) entre dans la boucle et increment j
T = 1e-4; h = T/100; n = 1000;%par exemple Ts = 0:T:n*T; j = 1; for t =0:h:n*T if t == Ts j = j+1; end end
le probleme que le programe vérifie la condition (t == Ts) mais apprés ne vérifié pas svp aide moi

답변 (1개)

George Papazafeiropoulos
George Papazafeiropoulos 2014년 5월 25일
편집: George Papazafeiropoulos 2014년 5월 25일
T = 1e-4;
h = T/100;
n = 1000;%par exemple
Ts = 0:T:n*T;
j = 1;
for t =0:h:n*T
if ismembc(t,Ts)
j = j+1;
end
end

이 질문은 마감되었습니다.

태그

Community Treasure Hunt

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

Start Hunting!

Translated by