Skip to content

Instantly share code, notes, and snippets.

@amroamroamro
amroamroamro / README.md
Last active December 25, 2023 20:41
Fourier series animation

MATLAB code to demonstrate [Fourier series][1] representation of periodic signals (as a sum of sinusoidal functions).

The animation shows an approximation of a square wave signal using the first 4-terms of its Fourier series. (Change the parameters near the top of the code to manipulate the animations and explore other variations).

![animation1][6] ![animation2][7]

This was inspired by the following similar animations:

  • [Fourier Series Animation using Circles][2]
@amroamroamro
amroamroamro / README.md
Last active August 29, 2015 14:10
[MATLAB] benchmark for growing arrays

Goal

Comparing performance of growing arrays in MATLAB with and without pre-allocation, in addition to expanding the size in batches.

Refer to [this Stack Overflow thread][1].

Tests

There are two version of the tests:

  • one that adds columns to a matrix
  • one that adds rows to a matrix
@amroamroamro
amroamroamro / README.markdown
Last active October 4, 2017 15:36
[MATLAB R2014b] MEX config files for Intel Parallel Studio XE 2015

XML configuration files for compiling MATLAB MEX-files using Intel Parallel Studio XE 2015. Tested on Windows 8.1 64-bit with MATLAB R2014b, Visual Studio 2013, and Intel Parallel Studio XE 2015.

Here is an example:

>>> mex -f intel_cpp_15_vs2013.xml -v -largeArrayDims test.cpp
>>> test()
@amroamroamro
amroamroamro / Readme.md
Last active August 29, 2015 14:08
[MATLAB] benchmark for parsing cell-array of strings