How to take the convolution of two functions

12 ビュー (過去 30 日間)
JL
JL 2017 年 11 月 24 日
回答済み: Walter Roberson 2017 年 11 月 24 日
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 件のコメント
Matt J
Matt J 2017 年 11 月 24 日
What are the data types of a and b?
JL
JL 2017 年 11 月 24 日
The pulse wave is a matrix and the ilaplace is a function of t. I've tried evaluating it by f=f|t but it does not seem to help.

サインインしてコメントする。

回答 (1 件)

Walter Roberson
Walter Roberson 2017 年 11 月 24 日
For convolutions of functions, you have a few options:
  1. 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
  2. If you need formulas for the result, then use the symbolic toolbox to calculate the convolution integral
  3. 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

カテゴリ

Help Center および File ExchangeComputational Geometry についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by