标签: matlab image-processing
如您在图像中所见,如何将A和B与步幅3x3相乘? 有人可以向我解释我该怎么做吗?一些代码示例将不胜感激
答案 0 :(得分:2)
看起来您正在寻找的是
Result = repmat(A,2,2) .* B;
repmat沿每个维度重复矩阵A两次。您可以根据A和B的大小来指定重复矩阵的次数,只要A在B中适合整数倍即可:>
repmat
A
B
reps = size(B) ./ size(A); assert(all(mod(reps,1)==0)) Result = repmat(A,reps) .* B;