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 件のコメント
採用された回答
Andrei Bobrov
2016 年 5 月 14 日
a = ones(5);
out = zeros(size(a)*2-1);
out(1:2:end,1:2:end) = a;
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!