DevJourney · code I wrote while learning

q1.m

66 B
syms x
y=piecewise(-2<=x<=-1,-x-2,-1<x<1,x,1<x<=2,-x+2); 
fplot(y)