You are on page 1of 1

x = -2:0.

2:8;
t = [0.2 10 50];
a = 6;
k = 3;
b = 2;
figure(1)
hold on
for i = 1:3
u(i,:) = (a/2)*(erf((x-b)/sqrt(4*k*t(i))));
plot(x,u(i,:))
end
grid on
xlabel('x')
ylabel('Temperature')
legend('t = 0.2','t = 10','t = 50','Location','best')
title('Temperatures across material at t = 0.2, t = 10, and t = 50')

You might also like