For the triggered subsystem initial values: set the initial port value to 0, not [0]. You don't mention what version of MATLAB you are using, but this was an issue at one point in time. Current releases support the syntax you are using.
For the Data Store Memory issues: the Data Store Memory is not supported by HDL Coder. You can generate a library of all blocks supported by your installation of HDL Coder with the hdllib command. The complete list of supported blocks is in the documentation. A hardware-friendly implementation for memory is available through the RAM blocks that ship with HDL Coder. There are three RAM variations included with the product. They are:
- Single Port RAM
- Simple Dual Port RAM
- Dual Port RAM
Each implementation has a different interface. They can be found in the library created with hdllib, in the "HDL Demo Library" category. You can also open the HDL Demo Library directly with the command hdldemolib.
With only four storage locations, you can also consider using a Unit Delay for each of your four registers.
Best Answer