matlab, 偏微分clear all;nx=10;ny=10;hx=1/nx;x=linspace(0,1,nx+1);y=linspace(0,1,ny+1);x_plus_h=x+hx.*ones(1,nx+1);x_minus_h=x-hx.*ones(1,nx+1);for i=1:nx+1 for j=1:ny+1 f_x(j,i)=(f2(x_plus_h(i),y(j))-f2(x_minus_h(i),y(j)))./(2*hx); en
来源:学生作业帮助网 编辑:作业帮 时间:2024/06/20 16:46:42
![matlab, 偏微分clear all;nx=10;ny=10;hx=1/nx;x=linspace(0,1,nx+1);y=linspace(0,1,ny+1);x_plus_h=x+hx.*ones(1,nx+1);x_minus_h=x-hx.*ones(1,nx+1);for i=1:nx+1 for j=1:ny+1 f_x(j,i)=(f2(x_plus_h(i),y(j))-f2(x_minus_h(i),y(j)))./(2*hx); en](/uploads/image/z/6116773-13-3.jpg?t=matlab%2C+%E5%81%8F%E5%BE%AE%E5%88%86clear+all%3Bnx%3D10%3Bny%3D10%3Bhx%3D1%2Fnx%3Bx%3Dlinspace%280%2C1%2Cnx%2B1%29%3By%3Dlinspace%280%2C1%2Cny%2B1%29%3Bx_plus_h%3Dx%2Bhx.%2Aones%281%2Cnx%2B1%29%3Bx_minus_h%3Dx-hx.%2Aones%281%2Cnx%2B1%29%3Bfor+i%3D1%3Anx%2B1++++for+j%3D1%3Any%2B1++++++++f_x%28j%2Ci%29%3D%28f2%28x_plus_h%28i%29%2Cy%28j%29%29-f2%28x_minus_h%28i%29%2Cy%28j%29%29%29.%2F%282%2Ahx%29%3B++++en)
matlab, 偏微分clear all;nx=10;ny=10;hx=1/nx;x=linspace(0,1,nx+1);y=linspace(0,1,ny+1);x_plus_h=x+hx.*ones(1,nx+1);x_minus_h=x-hx.*ones(1,nx+1);for i=1:nx+1 for j=1:ny+1 f_x(j,i)=(f2(x_plus_h(i),y(j))-f2(x_minus_h(i),y(j)))./(2*hx); en
matlab, 偏微分
clear all;
nx=10;
ny=10;
hx=1/nx;
x=linspace(0,1,nx+1);
y=linspace(0,1,ny+1);
x_plus_h=x+hx.*ones(1,nx+1);
x_minus_h=x-hx.*ones(1,nx+1);
for i=1:nx+1
for j=1:ny+1
f_x(j,i)=(f2(x_plus_h(i),y(j))-f2(x_minus_h(i),y(j)))./(2*hx);
end;
end;
怎么把f_x(j,i)这个数值弄出来,应该有11个数值才对
function z=f2(x,y)
z=x.^3.*y.^2;
这是另一个文件
matlab, 偏微分clear all;nx=10;ny=10;hx=1/nx;x=linspace(0,1,nx+1);y=linspace(0,1,ny+1);x_plus_h=x+hx.*ones(1,nx+1);x_minus_h=x-hx.*ones(1,nx+1);for i=1:nx+1 for j=1:ny+1 f_x(j,i)=(f2(x_plus_h(i),y(j))-f2(x_minus_h(i),y(j)))./(2*hx); en
你的f_x是个11*11的矩阵