- Pre-process the image in MALTAB to store the image as a bitstream
- Use a "MATLAB Function" block inside Simulink to output 144 bits per call by reading from the preprocessed bitstream.
- Finally if you are looking to reconstruct the image, after the simulation, collect the received bits (rxBits) in the workspace and reconstruct the image as follows:
- Refer to the image below which shows the results after simulation

- de2bi: https://www.mathworks.com/help/comm/ref/de2bi.html
- bi2de: https://www.mathworks.com/help/comm/ref/bi2de.html
- mod: https://www.mathworks.com/help/matlab/ref/double.mod.html
- Using Persistent Variables in MATLAB Function Blocks: https://www.mathworks.com/help/hdlcoder/ug/using-persistent-variables-inside-matlab-function-blocks-for-hdl-code-generation.html

