How to convolve two equations
显示 更早的评论
I am trying to convolve two functions.
f(s) = (1-4s^2)^0.5
v(s) = sinc(s/pi)-0.5(sinc(s/2*pi))^2
I followed with entering in this:
w = conv(f,v,'full');
I keep getting an error. Would anyone know how to help? I'm not sure where I am going wrong?
6 个评论
M
2017-10-31
What is the error you get ? How do you define s ?
John D'Errico
2017-10-31
There are a few potential problems here.
1. Sinc uses the Signal Processing Toolbox.
2. This is not valid MATLAB code:
v(s) = sinc(s/pi)-0.5(sinc(s/2*pi))^2
Multiplication requires an "*". Leaving it out will generate an error. So depending on whats is, you might have done this:
v = sinc(s/pi)-0.5*(sinc(s/2*pi))^2
If s is a vector, then you needed to use a dot operator, though scalar multiplication and division are ok with * and / alone.
v = sinc(s/pi)-0.5*(sinc(s/2*pi)).^2
Likewise, f has problems. Note that this relation only lives for real values on the interval [-0.5,0.5]. As well, you need to use dot operators again for vector s. And again, multiplication REQUIRES an *.
f = sqrt(1-4*s.^2);
3. Were you wanting to do a symbolic convolution?
Asima Warner
2017-10-31
Asima Warner
2017-10-31
Walter Roberson
2017-10-31
Did you create
s = tf('s')
or using
syms s
? Either way, conv() is not valid for those.
Asima Warner
2017-10-31
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Numbers and Precision 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!