Nipon

Thursday, May 24, 2012

Consistent Random Number Generation in MATLAB

Problem: MATLAB does not generate consistent random values even after setting the random seed.
Issue: You are calling a function that is not using your random seed. For example you set the random seed for rand function while calling randn function.
Solution: make sure the same function is seeded that you are calling. For example randn('state',).

Wednesday, May 23, 2012

Have MATLAB run something on start


1. Create startup.m file in /Users//Documents/MATLAB (Adjust for other OS)
2. Enter the code you want to run on each time you run MATLAB
3. Restart MATLAB

* Make sure you run startup.m so you dont have any errors.
** It is important for your filename to be lowercase.