How to convolve two equations
Ältere Kommentare anzeigen
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 Kommentare
M
am 31 Okt. 2017
What is the error you get ? How do you define s ?
John D'Errico
am 31 Okt. 2017
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
am 31 Okt. 2017
Asima Warner
am 31 Okt. 2017
Walter Roberson
am 31 Okt. 2017
Did you create
s = tf('s')
or using
syms s
? Either way, conv() is not valid for those.
Asima Warner
am 31 Okt. 2017
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Numbers and Precision finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!