
Matlab2tikz is an Octave script for converting Octave figures into native TikZ/Pgfplots figures, which can then easily be incorporated into a LaTeX document. It supports the conversion of most Octave figures, including 2D and 3D plots.
This package is also compatible with the (nonfree) MATLAB software.