fast calculation of functions with two variables

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 example demonstrates this principle (which you should not use if you can) Data2D = zeros([xPoints yPoints]); for xi = 1:xPoints x =...