Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

To resolve issues starting MATLAB on Mac OS X 10.10 (Yosemite) visit:

Undefined function or variable 'in'.

Asked by wisnu on 5 May 2013
hello.. iam stuck over here on function gabor
function [out1 out2] = fn_gabor(c)
alpha = 1/sqrt(2);
for teta = pi/8:pi/8:pi;
for j = 2:5;
for x = -8:8;
for y = -8:8;
h = exp((-alpha^(2*j))*(x^2 + y^2)/2);
HI (x+9,y+9)= h;
Re = cos (pi*(alpha^j)*(x*cos(teta)+ y*sin(teta)));
RI (x+9,y+9)= Re;
Im = sin (pi*(alpha^j)*(x*cos(teta)+ y*sin(teta)));
II (x+9,y+9)= Im;
Rh = HI*RI;
Ih = HI*II;
R = conv(in,Rh);   %%%ERROR IN HERE
I = conv(in,Ih);
% Normalisasi
Ro = (R)/(max(max(R)));
Roa = mean (Ro);
Roav = mean (Roa);
Io = (I)/(max(max(I)));
Ioa = mean (Io);
Ioav = mean (Ioa);
% Magnitude hasil konvolusi
out = sqrt (Ro*Ro' + Io*Io');
outfil(t) = sqrt (Roav*Roav + Ioav*Ioav);
t = t + 1;
out1 = out;
out2 = outfil;

please help.. thank you..




No products are associated with this question.

1 Answer

Answer by John Doe on 5 May 2013
Edited by John Doe on 5 May 2013
Accepted answer

Well the reason is that you haven't defined 'in' anywhere.

My guess is that the input variable should be named 'in'. You haven't used the input 'c' anywhere in your function.

1 Comment

wisnu on 5 May 2013

so supposed to replace the variable 'in' in the code is? because function 'conv' is a vector

John Doe

Contact us