a problem in rectangular function.

1 visualizzazione (ultimi 30 giorni)
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]))

Risposta accettata

Davide Masiello
Davide Masiello il 21 Ott 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))

Più risposte (0)

Prodotti


Release

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by