MATLAB 偏微分方程数值解function U = finedif(f,g,a,b,c,n,m)h=a/(n-1);k=b/(m-1);r=c*k/h;r2=r^2;r22=r^2/2;s1=1-r^2;s2=2-2*r^2;U=zeros(n,m);for i=2:n-1 U(i,1)=feval(f,h*(i-1)); U(i,2)=s1*feval(f,h*(i-1))+k*feval(g,h*(i-1)) ... +r22*(

来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/16 14:41:36
MATLAB偏微分方程数值解functionU=finedif(f,g,a,b,c,n,m)h=a/(n-1);k=b/(m-1);r=c*k/h;r2=r^2;r22=r^2/2;s1=1-r^2;

MATLAB 偏微分方程数值解function U = finedif(f,g,a,b,c,n,m)h=a/(n-1);k=b/(m-1);r=c*k/h;r2=r^2;r22=r^2/2;s1=1-r^2;s2=2-2*r^2;U=zeros(n,m);for i=2:n-1 U(i,1)=feval(f,h*(i-1)); U(i,2)=s1*feval(f,h*(i-1))+k*feval(g,h*(i-1)) ... +r22*(
MATLAB 偏微分方程数值解
function U = finedif(f,g,a,b,c,n,m)
h=a/(n-1);
k=b/(m-1);
r=c*k/h;
r2=r^2;
r22=r^2/2;
s1=1-r^2;
s2=2-2*r^2;
U=zeros(n,m);
for i=2:n-1
U(i,1)=feval(f,h*(i-1));
U(i,2)=s1*feval(f,h*(i-1))+k*feval(g,h*(i-1)) ...
+r22*(feval(f,h*i)+feval(f,h*(i-2)));
end
for j=3:m,
for i=2:(n-1),
U(i,j)=s2*U(i,j-1)+r2*(U(i-1,j-1)+U(i+1,j-1))-U(i,j-2);
end
end
U=U';
第二行哪里错了

MATLAB 偏微分方程数值解function U = finedif(f,g,a,b,c,n,m)h=a/(n-1);k=b/(m-1);r=c*k/h;r2=r^2;r22=r^2/2;s1=1-r^2;s2=2-2*r^2;U=zeros(n,m);for i=2:n-1 U(i,1)=feval(f,h*(i-1)); U(i,2)=s1*feval(f,h*(i-1))+k*feval(g,h*(i-1)) ... +r22*(
memo1.Text:=memo1.Text+''''+edit1.Text+'''';
这要看你在memo1和edit1中写了些什么,memo1.text是表组件的过滤器