To install the Matlab2Tikz library, just follow the installation instructions in the Matlab2Tikz GitHub.
The easiest way to use the Matlab2Tikz library is with the custom function save_figure
.
Just create an empty script, copy the following code, paste it in the script, and save it as save_figure.m
. This script must be placed in the working directory of MATLAB, or you can include it into the MATLAB path.
function save_figure(fig_handle, fig_name, ppi)
%SAVE_FIGURE Saves any matlab figure in FIG, EPS, PNG or TIKZ format