Error with conv function. Using discrete functions but I keep getting an error.
Afficher commentaires plus anciens
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.
Réponse acceptée
Plus de réponses (1)
Walter Roberson
le 22 Déc 2017
Change
a = conv(y,y)
to
a = conv(y,y,'same');
Catégories
En savoir plus sur Correlation and Convolution dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!