How to take the convolution of two functions
21 views (last 30 days)
Show older comments
I'm trying to find the convolution of a x=rectangular pulse function and an f=inverse laplace transform function(found by doing ilaplace) however when I type the code y=conv(x,f) it throws these errors:
Error using conv2
Invalid data type. First and second arguments must be numeric or logical.
Error in conv (line #)
c = conv2(a(:),b(:),shape);
I've looked up many examples to try to fix this but so far none have worked.Any advice would be appreciated.
2 Comments
Answers (1)
Walter Roberson
on 24 Nov 2017
For convolutions of functions, you have a few options:
- Do not take the convolution of functions, take the convolution of vectors of values. This can be done in multiple ways, including by using filter() and methods involving fft(). This is discrete convolution and does not give you a formula for the result
- If you need formulas for the result, then use the symbolic toolbox to calculate the convolution integral
- If you need formulas for the result, in the special case of functions are 0 for negative values, then you can take the inverse laplace transform of the product of the laplace transforms of the two functions. http://mathfaculty.fullerton.edu/mathews/c2003/laplaceconvolutionmod.html
0 Comments
See Also
Categories
Find more on Fourier Analysis and Filtering in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!