a problem in rectangular function.

1 次查看(过去 30 天)
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]))

采纳的回答

Davide Masiello
Davide Masiello 2022-10-21
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 个)

产品


版本

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by