von pospiech | Mrz 11, 2012 | matlab

Matlab does not allow to combine use more than one colormap in a figure. However there are some possibilities to get around this problem, which are presented in this article. Initialization and export of figure For all plots the same initialization for the data and...
von pospiech | Feb 13, 2012 | matlab

In matlab the normal way to create plots with two y-axis is to use the command plotyy. This works quite simple, and creates equal tick locations for both data sets: xaxis = 0:0.1:25; y1 = linspace(12.1712,12.7679, length(xaxis)); y2 = linspace(0.3597,-28.7745,...
von pospiech | Jun 1, 2011 | matlab, Programming

Matlab has many possibilities to create plots even fancy ones. However its defaults are very seldom suitable to use the plots directly for a publication. The following minimal code demonstrates how to generate a pcolor plot for 2D data with x- and y-axis. The data was...
von pospiech | Mai 31, 2011 | matlab, Programming

If you come from the programming world of C/C++ or java or any other traditional programming languages you might fall into the trap of using for loops for the calculation of functions. This works as expected but it is much slower than what matlab can do. The following...
von pospiech | Mai 31, 2011 | matlab, Programming

A search on how to fill the area under a curve reveals that such questions are quite often asked. Here is the solution in a function file that I created for simplifying filled curve plots using matlabs fill function. function handle = filledcurve(x, y, zero,...
von pospiech | Mai 31, 2011 | matlab, Programming

In the following I present a solution to read data from a textfile which has the number of x-values (columns) in the first line, the number of y-values (rows) in the second line and in all following lines the matrix with size x times y. The principle reading of the...