Convolving two piecewise functions
26 views (last 30 days)
Show older comments
Is it possible to convolve using piecewise function like below ? I get error and don't know how to fix it
clc
clear
syms t
x=piecewise(-2<=t<1,2*(t+2).^2,1<=t<3,18,3<=t<5,-9*(t-5),0);
h=piecewise(0<=t<2,3*t,2<=t<4,-6*(t-3),0);
fplot(x)
hold on
fplot(h)
hold on
y(t)=conv(x,h,'same')
fplot(y)
grid
0 Comments
Answers (1)
Walter Roberson
on 27 Dec 2020
No. conv() is only for discrete values. To do convolution with functions use int()
2 Comments
Walter Roberson
on 27 Dec 2020
Error using conv2 Invalid data type. First and second arguments must be numeric or logical.
Error in conv (line 43) c = conv2(a(:),b(:),shape);
See Also
Categories
Find more on Assumptions in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!