How to Create a Plot with a Date Axis

One of the most common questions for Matlab users is how to plot data on a date axis.  Many times, an analyst will initially use Excel, but then decide that he or she wants more analytical capabilities or plotting options.  Excel has an easy way to plot data on a date axis, but to use a date axis in Matlab requires familiarity with a few functions.  Don’t worry, using Matlab for this task is not that hard and, like most of Matlab’s functions, allows a considerable degree of versatility.

Continue reading

The US Senate Needs to Go


The US Senate is one of two branches of Congress and has existed since the writing of the Constitution.  However, the Senate’s rule of equal representation for each state made little sense when the Constitution was written and makes no sense now.  Originally formulated by the Founding Fathers as a replicate of the British House of Lords, the Senate was meant to be run by the upper classes who would protect large property owners from democracy.  Additionally, the Founding Fathers were anxious to get all 13 American colonies to join the United States and were willing to make concessions to smaller colonies to assure their membership.  In the original thirteen states, the ratio between the largest and smallest populations was 11 to 1, between Virginia and Delaware.  Today, California has 66 times the population of Wyoming, and the citizens of Wyoming have 66 times as much representation in the Senate.

Continue reading

How to Do a Fourier Transform in Matlab

The Fourier transform is one of the most useful mathematical tools for many fields of science and engineering.  The Fourier transform has applications in signal processing, physics, communications, geology, astronomy, optics, and many other fields.  This technique transforms a function or set of data from the time or sample domain to the frequency domain.  This means that the Fourier transform can display the frequency components within a time series of data.  The Discrete Fourier Transform (DFT) transforms discrete data from the sample domain to the frequency domain.  The Fast Fourier Transform (FFT) is an efficient way to do the DFT, and there are many different algorithms to accomplish the FFT.  Matlab uses the FFT to find the frequency components of a discrete signal.

Continue reading

Dynamic Variable Names in Matlab

Assume that you want to create a variable in Matlab whose name is contingent on factors that are unknown before the program runs.  For example, you may want to attach a time or date stamp to the end of a variable name.  You may also have variable names stored in a string or cell array that you want to instantiate as variables.  The best way to accomplish these tasks in Matlab is to use the eval function.  In the following examples, we’ll show you how to do these tasks.

Continue reading