how to multiply an image by a cosine(x) function?

i've tried but there shows some dimension problem....plzz give an exam

2 Comments

Tulika - please update your question to include the code you have used to apply the cosine function. As well, if there is an error message, include that as well.
f=zeros(600,600); f(50:80,1:50)=1; f(10:100,50:150)=1; f(1:600,180:210)=1; f(20:120,250:350)=1; f(40:80,350:380)=1; f(1:80,380:410)=1; f(40:80,410:450)=1; f(5:100,450:550)=1; f(1:600,570:590)=1; f(200:300,50:150)=1; f(300:350,70:120)=1; f(350:400,1:180)=1; f(200:300,250:350)=1; f(240:260,350:400)=1; f(260:600,380:400)=1; f(430:530,50:150)=1; f(320:420,250:350)=1; f(360:380,350:380)=1; f(340:400,400:450)=1; f(330:410,450:560)=1; f(220:300,480:580)=1; f(300:330,510:560)=1; f(440:540,450:550)=1; figure,imshow(f,'InitialMagnification','fit'); x=linspace(-pi, pi, 100); sf=6; sinewave=sin(x*sf); onematrix=ones(size(sinewave)); sinewave2D=(onematrix'*sinewave); imagesc(sinewave2D); imagesc(sinewave2D) colormap(gray) axiss off; axis off; x=linspace(-pi, pi, 100); sf=6; sinewave=sin(x*sf); onematrix=ones(size(sinewave)); sinewave2D=(onematrix'*sinewave); imagesc(sinewave2D) A=(f.*sinewave2D); A=immultiply(f,sinewave2D); A=(f. *sinewave2D);
i dont kno what is the problem i'm very new to matlab

Sign in to comment.

 Accepted Answer

See attached test.m which will produce this image.

More Answers (0)

Asked:

on 3 Jul 2014

Commented:

on 3 Jul 2014

Community Treasure Hunt

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

Start Hunting!