Speeding it up

There are a couple of reasons why your app might be running slowly.  Here are a few tips to make it run faster:

1.  Vectorize your code.  See the mathworks help and documentation in both the help files and online.  Vectorizing your code (using matrix or array commands instead of for loops) is at least 15 times faster than for loops.

2.  In general, use matlab commands whenever possible instead of your own code, especially when you are about to introduce a for loop.

3.  Use R13.  It is highly optimized to be much faster than older versions.

4.  Minimize screen printing and graphing.  This is incredibly slow.

5.  Use the profile command to find out which of your functions are taking all the time.  Read about it in the help files.  It tells you which functions are taking exactly what percentage of CPU time and gives you plots, etc.