精选优质文档-倾情为你奉上(1)迎风格式function u = peHypbYF(a,dt,n,minx,maxx,M)format long;h = (maxx-minx)/(n-1);if a0 for j=1:(n+M) u0(j) = IniU(minx+(j-M-1)*h); endelse for j=1:(n+M) u0(j) = IniU(minx+(j-1)*h); endend u1 = u0; for k=1:M if a0 for i=(k+1):n+M u1(i) = -(dt/h)*a*(u0(i)-u0(i-1)+u0(i); end else for i=1:n+M-k u1(i) = -(dt/h)*a*(u0(i+1)-u0(i)+u0(i); end