Here is an implementation of Heun's method in MATLAB:
main.m829 chars21 linesTo use this function, you can define your differential equation as a function handle and then call heun with necessary arguments:
main.m248 chars7 lines
gistlibby LogSnag