Jin, thanks for testing this code, I think you are one of the very few.
I cannot replicate this error, my model runs fine using code from the distributed toolboxes. The things I would do to resolve this:
- start a brand new MATLAB session
If that doesn't help, then you'll need to do some debugging.
- First modify slcamera so the first 2 lines look like this
function p = slcamera(cam, u)
u'
- From Simulink window menu, select View/Diagnostic View which brings up a new window, it will show the values now being passed to slcamera
- Run the simulation
- After it fails cut and paste the output of the diagnostic view to me.