I am unable to plot this graph. Any one please help me to plot?
f = double(X<20).* (0) + ...
double(and(X>=20,X<35)).* ((X-20)./15) + ...
double(X>=35).*(1);
g = double(X<20).* (1) + ...
double(and(X>=20,X<35)).* ((35-(X))./(15)) + ...
double(X>=35).*(0);
figure;
plot(X,f,'r','linewidth',2);
hold on ;
plot(X,g,'b','linewidth',2); xlabel('X');grid on;xticks(2:1:10);
legnd('f(x)','g(x)')
In other words, I want to plot the following functions:

