clc
clear
disp("Kaliyah Johnson")
x = -5:0.1:10;
for i = 1:length(x)
if x(i) < -1
y(i) = exp(x(i)+1);
elseif x(i) <= 5
y(i) = 2+cos(pi*x(i));
else
y(i) = 10*(x(i)-5)+1;
end
end
plot(x,y)
To embed this project on your website, copy the following code and paste it into your website's HTML: