DevJourney · code I wrote while learning
1syms x 2y=piecewise(-2<=x<=-1,-x-2,-1<x<1,x,1<x<=2,-x+2); 3fplot(y)