Is there a canonical/performant way to reduce arrays/matrices by removing the border values?

前端 未结 0 878
挽巷
挽巷 2020-11-30 19:31

A motivating issue, implemented in Matlab:

N = 1000;
R = zeros(2*N);

for i=0:N-1
    R = R(2:end-1, 2:end-1);
end

For this code timeit() giv

相关标签:
回答
  • 消灭零回复
提交回复
热议问题