Error with conv function. Using discrete functions but I keep getting an error.
Mostrar comentarios más antiguos
Here's my Code
----
%f(n) = u(n) − u(n − 4);
x = -10:10;
y = (x >= 0) & (x < 4);
stem(x,y);
a_x = -10:10;
a=conv(y,y);
stem(a_x, a);
title('f(n) * f(n)');
-----
The error im getting is this ERROR;
Undefined function 'conv2' for input arguments of type 'char'.
Error in conv (line 40)
c = conv2(a(:),b(:),shape);
---
Also I'm running by section and line 40 is not within it. Plus when I comment out the conv function that I am calling the error disappears.
Respuesta aceptada
Más respuestas (1)
Walter Roberson
el 22 de Dic. de 2017
Change
a = conv(y,y)
to
a = conv(y,y,'same');
Categorías
Más información sobre Correlation and Convolution en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!