Hi Li Chen,
‘sensor' is a Handle class object of the class ‘monoCamera’. A handle class object cannot be an entry-point (top level) function input or output.
Refer this documentation page to declare a MATLAB class that supports codegen.
If the purpose of ‘sensor’ handle class object is just to pass data from one function to another, you could instead convert ‘sensor’ to a structure and pass it as an output argument to the function ‘gen_camera’.
You can add this line at the end of your fucntion ‘gen_camera’.