To jest stara wersja strony!
y=[0.67 0.67 0.67 0.67 0.67 0.02 0.02 0.02 0.02]; temp = 727; R = 8.3144; Q = 140000; temp_k = temp + 273; d0= 0.000041; D = d0 * exp( -Q /( R * temp_k)) * 1 * 10^10; dt = 1; dx = 1; tmp = (D*dt)/dx^2; n = 100; [s_h s_w] = size(y); y2 = zeros(1, s_w); for j = 1:n for i = 1:s_w im = i-1; ip = i+1; if im < 1 im = 1; end if ip > s_w ip = s_w; end y2(i) = (1 - 2*tmp)*y(i) + tmp*(y(im) + y(ip)); end y = y2; end plot(y2, 'DisplayName', 'y2', 'yDataSource', 'y2');