Heat=1.0; Nx=10; Ny=20; for i=1:Nx for j=1:Ny heating(i,j)=-Heat*(sin(pi*(2*j/Ny)));; end end Stress=1.0; Nx=10; Ny=20; for i=1:Nx for j=1:Ny stress(i,j)=-Stress*(cos(pi*(2*j/Ny))); end end for i=1:Nx for j=1:Ny stressy(i,j)=-Stress*(cos(pi*(2*j/Ny))); end end for i=1:Nx for j=1:Ny stressx(i,j)=-Stress*(cos(pi*(2*i/Nx)));; end end stress=stressx+stressy;