Please download this example. It runs in matlab and simulink. (See the readme).