Smoothing just part of the data
조회 수: 5(최근 30일)
I have a 5000x1 array. I'd like to smooth the data from 500:1500 with the function smooth. For now i have created another array 1000x1 with the smoothed data and then overwritten the 500:1500 data in the original array, but is there an easier way to do it?
John D'Errico 2022년 4월 11일
Um, No. Why should there be?
In fact, extracting the part you want to smooth, and then overwriting that smoothed fragment back into the array seems crystal clear, easy to implement, easy to debug, easy to read, and as fast an any other scheme could be. So why should there be another way?