1. maven like file tree

Though https://maven.org and https://gradle.org is not recommended to use here, but the file tree schema found with maven is used in an adequate form.

The_Working_Tree_or_Sandbox
 |
 +-build     ... temporary stuff
 +-libs      ... some content loading from internet
 |
 +-src
    +-test   ... test stuff, here some examples
    |  +-Smlk
    |     +-+inspcStimuli ... Test and example projects
    |
    +-src    ... sources, here Simulink library elements.
       |
       +-Smlk ... Simulink sources
          +-libSmlk ... some usefull Simulink libraries
          +-ApplXYZ ... the users Application im Simulink
  • General there are build libs and src.

    • build gets the build stuff, it is temporary, I prefer to have a link here (Windows "Junction") to a RAM disk, to increase speed and save unnecessary SSD-accesses.

    • libs contains a bom*.txt, a 'bill of material' and contains files loaded one time from internet. All stuff from internet is stored here, not in ominous Windows/User directories.

    • src the sources.

Below src there is generally test and main which is the main source for an application or for Libraries which are sources for applications. Firstly there is a subdivision to the technologies, cpp for C/++ sources, Smlk for Simulink stuff etc.

The_Working_Tree_or_Sandbox
 |
 +-IDE     ... IDE environments
 +-MexDbg  ... debug version of S-Function
  • Additional from the root there are an IDE folder with some Integrated Development Environments for testing. This should be part of src/test or src/main ? Usual the build of an application or for tests is done by scripting, not by an IDE. The scripts are short. The IDE has often the disadvantage that it contains some Megabyte of temporary stuff. If sources are zipped, copied to a build machine (I use Linux temporary because gcc is faster) or such, it is more practicable to separate it.

  • The mex are dll for any S-Function, see Simulink-Documentation. The used mex files are part of the adequate Library, always available and able to run on any Windows PC. They are stored in

    The_Working_Tree_or_Sandbox
     |
     +-src/main/Smlk/libSmlk    ... contains all simulink vishia Libs
                      |
                      +-mex     ... the associated mex files for S-Function.
  • The mexDbg can be generated if a S-Function debugging approach is given. They may be temporary only till the problem is solved. This mexDbg is prior in the Simulink Path, to find the debug version of mex firstly. If it is empty, it uses the release-Version stored beside the library. The mexDbg is on root level of the Sandbox, to see it (obviously). It should be deleted if not necessary. It should have its fix position in the file tree because of the Simulink Path.

2. src_emC

The src_emC are used for S-Function. They are only necessary if the S-Functions should be newly generated, or if code generation is used. They are able to download on demand, not part of a Smlk_ObjO_Inspc_yyy-mm-dd.zip, adequate the libs content.

The_Working_Tree_or_Sandbox
 |
 +-src/main/cpp
             +-...      ... files to get emC sources
             +-src_emC  ... the sources itself, or empty.
The_Working_Tree_or_Sandbox
 |
 +-src          .. This is the root of Simulink
    +-setupMatlabPath.m  ...to setup the simulink path
    +-test
    |  +-Smlk
    |
    +-main
       +-Smlk

It is recommended to set the root path of Simulink outside of a specific Simulink project. This is more proper to unique address Simulink stuff. But the Sandbox root is too much outside. Hence the src is recommended as root for Simulink. All scripts regards it. You must set the 'Current Folder' of Simulink to The_Working_Tree_or_Sandbox\src and then execute the setupMatlabPath.m. You can select your model in the file tree of simulink without double click. If you have selected a special folder, go back again.

Simulink uses internally a path structure with directories beginning with + The path inside a matlab script do not contain the +, but the directory is accepted as an internal path. See examples.