What about taking as trlbegin = indx(j) - xxxx; trlend = indx(j+1) + yyyy; jm PS: the quiz now is to appropriately choose your xxxx, and yyyy. Happy computing! -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20041213/3cfdbc80/attachment-0002.html>