MATLAB: Generic error by MATLAB Coder

matlab coder

I am trying to use the MATLAB Coder app to compile a MATLAB function into C code, but I get the following generic error:
"Generation of trial code failed"
When I press the view errors button, nothing is showed.
When I use the "codegen" command for just code generation (without any sort of compiling), I get the following error:
??? CODEGEN requires a MATLAB Coder license.
I have a floating network license. How do I resolve this? 

Best Answer

The issue occurs because of the unavailability of license. However, the Coder app is supposed to warn you about the unavailability of the license. This lack of warning is a known bug and has been fixed for R2017b. For now, you can use the following command as a workaround to ascertain that you have the MATLAB Coder license available before proceeding to the Coder app:
>> license('checkout','MATLAB_Coder')