Borrar filtros
Borrar filtros

Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

problem with if test to test the increment in time

1 visualización (últimos 30 días)
chikha said
chikha said el 25 de Mayo de 2014
Cerrada: MATLAB Answer Bot el 20 de Ag. de 2021
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

Respuestas (1)

George Papazafeiropoulos
George Papazafeiropoulos el 25 de Mayo de 2014
Editada: George Papazafeiropoulos el 25 de Mayo de 2014
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

La pregunta está cerrada.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by