Hi Jasper,
In order to build code for a stateflow chart you will need to have both RTW toolbox as well as Stateflow Coder.
To check for this you can first use the VER command to see if the installation exsists. If it does you can then perform the LICENSE command for 'stateflow_coder' to see if that toolbox can be checked out. If not there may be an issue with that toolboxes installation.