Even and odd part of function

Hi, I have to find the even and the odd part of this function, and plot them.
I do this
syms t
y = piecewise(1 < t < 3, t-1, 0);
fplot(y)
and then?

 Accepted Answer

syms t
y = symfun( piecewise(1 < t < 3, t-1, 0) ,t);
yeven=(y(t)+y(-t))/2
yeven = 
fplot(yeven)
and similarly for the odd part.

3 Comments

FEDERICO RODELLA
FEDERICO RODELLA on 14 Nov 2022
Edited: FEDERICO RODELLA on 14 Nov 2022
Ok thank you so much :)
Matt J
Matt J on 14 Nov 2022
Edited: Matt J on 14 Nov 2022
You are quite welcome, but please Accept-click the answer if your question is resolved.
Ok sorry 😅

Sign in to comment.

More Answers (0)

Categories

Find more on MATLAB in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!