help with nested loops error
Mostrar comentarios más antiguos
Somehow only first step in a loop is executed:
spiketime = (1:3:100);
stim = (1:10:100);
for i=1:size(stim);
for t = 1:size(spiketime);
if abs(spiketime(t)-stim(i)) < 3;
spiketime(t) = [];
end
end
end
What am I missing?
2 comentarios
per isakson
el 4 de Mzo. de 2017
Replace
size(stim);
by
length(stim)
Roger Vota
el 7 de Mzo. de 2017
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Loops and Conditional Statements en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!