function calor1d(b) if nargin<1 b = [1]; end b = b(:); x = [0:.01:1]; N = length(b); n = [1:N]'; seno = sin(n*pi*x); ff = b'*seno; span = max(ff)-min(ff); top = max(ff)+span/10; bot = min(ff)-span/10; t = [0:0.01:0.2]; for i=1:length(t) u(i,:) = (b.*exp(-(n*pi).^2*t(i)))'*seno; plot(x,u(i,:)) axis([0 1 bot top]) title(sprintf('t = %g', t(i))); if (i < 4) pause else pause(0.02) end end pause plot(x,u) title('perfil de temperatura para varios instantes de tiempo') pause surf(x,t,u) title('perfil de temperatura para varios instantes de tiempo') pause plot(t,u(:,51)) title('evolucion de la temperatura en el punto medio')