a problem in rectangular function.
1 view (last 30 days)
Show older comments
mehdi Jafari
on 21 Oct 2022
Answered: Davide Masiello
on 21 Oct 2022
I have a problem in ploting rectangular function. when i plot using fplot commnd, everything is ok, but when i try to plot it using plot function and just substitution of range by myself, i got another diagram.
and i want to evaluate convolution of two ractangular functions. how can i do that?sth like this:
conv(subs(f,a,1),subs(f,a,2))
please help, thanks.
a=1;
syms t
f=piecewise(a / 0.2e1 < abs(t), 0, abs(t) == a / 0.2e1, 0.1e1 / 0.2e1, abs(t) < a / 0.2e1, 1);
fplot(f)
plot(subs(f,t,[-4:4]))
0 Comments
Accepted Answer
Davide Masiello
on 21 Oct 2022
You are using plot incorrectly, see below.
a=1;
syms t
f=piecewise(a / 0.2e1 < abs(t), 0, abs(t) == a / 0.2e1, 0.1e1 / 0.2e1, abs(t) < a / 0.2e1, 1);
fplot(f)
plot(-5:0.001:5,subs(f,-5:0.001:5))
0 Comments
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!