Date: Mar 11, 2013 12:39 PM
Author: dpb
Subject: Re: Error in addition of two matrices

On 3/11/2013 11:21 AM, nimesh wrote:
> a=[5,18,27];
> f=1;
> mn=zeros(a(3),a(2));
> tmp=zeros(a(3),a(2));
> obj=Img1(f,a);
> for i=1:a(1)
> str=strcat('img/1_',int2str(i),'.png');
> tmp=imread(str);
> mn(:,:) = mn(:,:) + tmp(:,:);
> end
>
> I want to find mean of all images but it is showing error on line 10 on
> addition. Please help.


d=dir('img/1_*.png');
n=length(d)
m=imread(d(1).name);
for i=2:n
m=m+imread(d(i).name);
end
m=m/n;

--