This is an example of how you can use App Designer tool to build program to control any hardware over supported protocol (i.e. serial).
App Designer has visual instrumentation components (knobs, swithes, etc.) so it allows you to build interactive apps for instrument control.
The submission contains a scheme of Arduino based simple device with RGB LED and photoelectric cell. Simulink program for Arduino is provided. With interactive program you can control the RGB LED color and observe illuminance level over the serial connection. If you don't have Arduino you can simulate it from Control App.
Describing video for v2.1 R2016a version (on Russian, enable auto-translate captions)
Execute in MATLAB
eval(webread('https://exponenta.ru/install/led'))