Convolution Command: Inputs Invalid
4 次查看(过去 30 天)
显示 更早的评论
I am having trouble getting the output of my two functions to be accepted by the convolution function. Any help is appreciated getting this to work. I get the following when I use conv: Invalid data type. First and second arguments must be numeric or logical. I am familiar with matlab and can do the plots and other aspects once I get the function working. Thank you in advance for any help. I attached my code below:
t = -5:10; syms n x1 = symsum(dirac(t-8.*n),n,0,5); h1 = exp(-t).*heaviside(t); H1 = h1.'; Yt = conv(x1,h1);
My two functions are: x(t)=Sum(from 0-5) dirac(t-8n) h(t)=e^(-t)*u(t)
where u(t) is the step function
2 个评论
Image Analyst
2018-9-23
Why are you using symbolic variables? Can't you just use numerical values with actual values for the elements?
采纳的回答
Viren Gupta
2018-9-27
I tried relicating your code. x1 is of type sym. You can convert x1 into numeric type using double(x1). That should solve the error. 'h1' is already a numeric type variable
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Assumptions 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!