How to create a sliding window for a matrix with some overlapping elements?
1 次查看(过去 30 天)
显示 更早的评论
Hi all,
I have a very large matrix with 200.000 rows and 300 columns. I need to apply some processing to a window of 5000 elements and this window has to shift every 10 elements. I mean: at the first iteration I want a window with all the columns (300) and the rows from 1 to 5000, then at the second iteration I want all the columns (300) and the rows from (1+shift) to (5000+shift) so from the row 11 to the row 5011; at the third iteration from ow 21 to row 5021 and so on until I finish to read my total matrix of dimensions 200.000 x 300.
I've read on the Web about some solutions, they all work but only with small matrices. Is there a way to obtain the result I ask for with a good time of response from Matlab?
I mean that I tried to put shift = 1000 instead that shift = 10 inside my code and Matlab gives me a result in 1 minute, so with shift = 10 I have to wait a LOT.
Thank you very much for your answers
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!