Matrix Zero padding for filter (image processing)
2 次查看(过去 30 天)
显示 更早的评论
I have a matrix and size 5x5. I want to zero padding between each row and column. Thus, result matrix is 9x9 after zero padding. I'll use this in wavelet zero-padding. Thanks!!
matrix = ones(5)
result_matrix = [1 0 1 0 1 0 1 0 1;
0 0 0 0 0 0 0 0 0;
1 0 1 0 1 0 1 0 1;
0 0 0 0 0 0 0 0 0;
1 0 1 0 1 0 1 0 1;
0 0 0 0 0 0 0 0 0;
1 0 1 0 1 0 1 0 1;
0 0 0 0 0 0 0 0 0;
1 0 1 0 1 0 1 0 1]
0 个评论
采纳的回答
更多回答(1 个)
Azzi Abdelmalek
2016-5-14
matrix = ones(5)
n=size(matrix,1)
result_matrix=zeros(2*n-1)
result_matrix(1:2:end,1:2:end)=matrix
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!