Browsed by
Author: Antonin

Anonymous Functions in Matlab

Anonymous Functions in Matlab

There is a way to create a one-line expression-based MATLAB function that does not require a program file. It is called an anonymous function. The following very simple example shows how it works. It is very useful when you want to calculate the values without storing them to a variable (vector, or matrix) while keeping the code simple (without creating another program file).

AAA: Acoustics of a Fish-Tank

AAA: Acoustics of a Fish-Tank

A. Novak, M. Bruneau & P. Lotton (2018), “Small-Sized Rectangular Liquid-Filled Acoustical Tank Excitation: A Modal Approach Including Leakage Through the Walls”, Acta Acustica united with Acustica. Vol. 104(4), pp. 586-596. PDF file of the paper (accepted version)

Export Matlab plots for presentations and publications

Export Matlab plots for presentations and publications

When it comes to presentations and report/paper writing (either in Word/Powerpoint or in LaTeX/Beamer), the question of how to generate good looking Matlab figures is very often neglected by many students but unfortunately also by many researchers and academics. In this short post I show how I’m used to export my graphs. To take a simple example, the following Matlab script generates a graph with two impedance curves of an electrodynamic loudspeaker for two different mechanical stiffnesses $K_{ms}$. The most…

Read More Read More

How to put several 2D lines in a 3D grayscale plot

How to put several 2D lines in a 3D grayscale plot

It is sometimes convenient to display several 2D curves on one 3D graph and choose gray-scale colors so that the printed version of the figure is readable. The following Matlab code (an example of a loudspeaker’s low-frequencies pressure outputs for different quality factors $Q_{ts}$) shows how to do it.

Define LaTeX colors that match Matlab plots

Define LaTeX colors that match Matlab plots

There exist several methods to define a specific color in LaTeX. My favorite one uses the xcolor package. First, place it to the preamble of the LaTeX file: Then, you can define a new color as and use it in LaTeX text as Finally, the following colors correspond to those of Matlab plot (starting from version R2014b) The following colors have been used in older versions of Matlab.

Synchronized Swept Sine

Synchronized Swept Sine

Synchronized-Swept-Sine method is a nonlinear system identification method based on “nonlinear convolution” presented by Angelo Farina in AES 108th convention in Paris in 2000. The method can analyze a nonlinear system in the terms of higher order impulse responses using a single swept sine signal with user-defined frequencies and duration. The synchronization of the swept sine, described in [1], allows the phase synchronization of the higher order impulse responses. The higher order impulse responses can be next used, in several ways, to nonlinear modeling…

Read More Read More