In terms of the generated code, selecting the "Source Code" build type is actually equivalent to selecting the "Static Library" build type and checking the "Generate code only" checkbox. To confirm this for yourself, you can click on the "Action menu" in the top right corner of the MATLAB Coder App and select "Convert to script ... " for each build type. Comparing the generated MATLAB scripts reveals that the same commands are executed in both cases. However, the GUI for the "Source Code" build type does not let you set the "Output file name" field, which is what determines the project name.
As a workaround, you can select the "StaticLibrary" build type, check the "Generate code only" checkbox, and enter a custom name in the "Output file name" field.
Best Answer