changes sim() to simulate() because sim() is a matlab builtin