Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

error in conv function

Status
Not open for further replies.

electroboy

Member level 5
Joined
Dec 30, 2010
Messages
86
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,879
in matlab ,i wrote a code like this

v=-20:100;
im=(v==0);
b=[2 0 0];
g=conv(im,b)

i get the following error,

??? Error using ==> conv2
First and second arguments must be single or double.

Error in ==> conv at 40
c = conv2(a:)),b:)),shape);

Error in ==> del at 4
g=conv(im,b)


please tell me why...? am i wrong??

thanks in advance... please tell me as early as possible...
 

the question may be very silly... but i cant understand it anyway.. so please help..
 

I've tried your program with Matlab R2008a.

For
g=conv(im,b)
it works fine.

For
g=conv2(im,b)
I get the same error.

But if I do this
g=conv2(double(im),b)
then it gives me no error, and the result is
g =
Columns 1 through 18
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Columns 19 through 36
0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Columns 37 through 54
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Columns 55 through 72
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Columns 73 through 90
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Columns 91 through 108
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Columns 109 through 123
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top