% define ODE rhs function rhs=rhs(tspan,u,dummy,k,dx,A) rhs=(k/dx^2)*A*u;