clc
clear all
%A = imread('2.bmp');
%mimshow(A);
A=[1 2 3; 4 5 6; 7 8 9];
[m,n]=size(A);
C=zeros(m+2,n+2);
B=[1 1 1; 1 1 1;1 1 1];
[p,q]=size(B);
%m=m+1;
%n=n+1;
for i=1:m
for j=1:n
C(i+1,j+1)=A(i,j);
end
end
resultant=0;
for i=1:p
for j=1:q
resultant=resultant+(C(i,j).*B(i,j));
end
end
resultant/9
clear all
%A = imread('2.bmp');
%mimshow(A);
A=[1 2 3; 4 5 6; 7 8 9];
[m,n]=size(A);
C=zeros(m+2,n+2);
B=[1 1 1; 1 1 1;1 1 1];
[p,q]=size(B);
%m=m+1;
%n=n+1;
for i=1:m
for j=1:n
C(i+1,j+1)=A(i,j);
end
end
resultant=0;
for i=1:p
for j=1:q
resultant=resultant+(C(i,j).*B(i,j));
end
end
resultant/9
No comments:
Post a Comment