clc
clear

disp "Taylor Waller"

x= linspace(-6, 7, 1000);

y= zeros(size(x));

y(x<= -6 & x <= -2) = -3;
y(x<= -2 & x <= 3) = 2;
y(x<= 3 & x <= 7) = 5;

plot (x,y, 'b-', 'LineWidth', 2);

title('Plot of Piecewise Function');
xlabel('x');
ylabel('g(x)');

xlim([-7, 8]);
ylim([-4, 6]);
grid on;

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: