how to subtract 2 cell array??

im=imread('cameraman.tif');
im1=imread('cameraman.tif');
[wc,s] = wavedec2(im,3,'db1');
[ca,la] = wavedec2(im1,3,'db1');
[a,v,d,h]=swt2(im,3,'sym4');
[a1,v1,d1,h1]=swt2(im1,3,'sym4');
mean1=(a+a1)/2;
vout=blocksize(v);
dout=blocksize(d);
hout=blocksize(h);
v1out=blocksize(v1);
d1out=blocksize(d1);
h1out=blocksize(h1);
for x=1:3
for y=1:3
sumvout=vout(x,y);
sumdout=dout(x,y);
sumhout=hout(x,y);
sumv1out=v1out(x,y);
sumd1out=d1out(x,y);
sumh1out=h1out(x,y);
end
end
%calculate mean for host image
[m,n]=size(vout);
for i=1:m
for j=1:n
meanValues1 = cellfun(@(x) mean(x(:)),vout);
end
end
[m1,n1]=size(dout);
for i=1:m1
for j=1:n1
meanValues2 = cellfun(@(x) mean(x(:)),dout);
end
end
[m2,n2]=size(hout);
for i=1:m2
for j=1:n2
meanValues3 = cellfun(@(x) mean(x(:)),hout);
end
end
[m3,n3]=size(vout);
for i=1:m3
for j=1:n3
meanValues4 = cellfun(@(x) std(x(:)),vout);
end
end
  • i have to subtract meanvalues3 from meanValues4.but i m getting error *

Respuestas (1)

Azzi Abdelmalek
Azzi Abdelmalek el 3 de Mayo de 2014

0 votos

a={1 2 3}
b={10 20 30}
c=cellfun(@(x,y) x-y,a,b)

3 comentarios

divi
divi el 3 de Mayo de 2014
thank you sir...but ,i m getting error subtract meanvalues3 from meanValues4.run tat code and help me
Type
whos meanvalues3 meanValues4
What did you get?
divi
divi el 3 de Mayo de 2014
Editada: Azzi Abdelmalek el 3 de Mayo de 2014
im=imread('cameraman.tif');
im1=imread('cameraman.tif');
[wc,s] = wavedec2(im,3,'db1');
[ca,la] = wavedec2(im1,3,'db1');
[a,v,d,h]=swt2(im,3,'sym4');
[a1,v1,d1,h1]=swt2(im1,3,'sym4');
mean1=(a+a1)/2;
vout=blocksize(v);
dout=blocksize(d);
hout=blocksize(h);
v1out=blocksize(v1);
d1out=blocksize(d1);
h1out=blocksize(h1);
for x=1:3
for y=1:3
sumvout=vout(x,y);
sumdout=dout(x,y);
sumhout=hout(x,y);
sumv1out=v1out(x,y);
sumd1out=d1out(x,y);
sumh1out=h1out(x,y);
end
end
%calculate mean for host image
[m,n]=size(vout);
for i=1:m
for j=1:n
meanValues1 = cellfun(@(x) mean(x(:)),vout);
end
end
[m1,n1]=size(dout);
for i=1:m1
for j=1:n1
meanValues2 = cellfun(@(x) mean(x(:)),dout);
end
end
[m2,n2]=size(hout);
for i=1:m2
for j=1:n2
meanValues3 = cellfun(@(x) mean(x(:)),hout);
end
end
[m3,n3]=size(vout);
for i=1:m3
for j=1:n3
meanValues4 = cellfun(@(x) std(x(:)),vout);
end
end

Iniciar sesión para comentar.

Categorías

Productos

Etiquetas

Preguntada:

el 3 de Mayo de 2014

Editada:

el 3 de Mayo de 2014

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by