Quick-fix: MATLAB FMU import error

MATLAB 2017b introduced support for the Functional Mock-up Standard by providing FMU-import blocks in Simulink. This open standard enables mixing of simulation models created with different tools, like prototype controllers before coding them. This is an extremely powerful feature that I will write more about in soon. This memo, however, is about an error that occurred to me when importing an FMU in Simulink and how to fix it. 

The error is something like:

The FMU error dialog, shown by MATLAB
Error parsing FMU ‘dq.fmu’. Caused by: – Error in supplied FMU: Dynamic library file (‘dq.dylib’) does not exist in FMU ‘dq.fmu’.

Continue reading Quick-fix: MATLAB FMU import error

Matlab2Tikz: Perfect MATLAB Figures in LaTeX

MATLAB exported TikZ picture with custom stylingPapers and reports can’t do without both but integrating MATLAB figures in LaTeX is not so obvious. Different methods for exporting and including graphics exist but have various downsides like inconsistent scaling, wrong fonts and strange spacing. The best method I have come across so far is using matlab2tikz. It is a MATLAB script that is able to extract all relevant details out of a figure and convert it to PGFPlots (a LaTeX package).

Continue reading Matlab2Tikz: Perfect MATLAB Figures in LaTeX