Note: In order to use the UART Tx-Matlab block in a Simulink® model, it is necessary to first include and set up the UART Configuration block .
The UART Tx-Matlab block allows sending variables to MATLAB through UART. The protocol used allows sending up to 16 distinct channels, each channel being composed of data of type uint8, int8, uint16 or int16.
Each channel can be sent using a different sampling rate. Data is typically sent continuously. The MATLAB script (used in the picgui block) decodes the data that supports hot plug. The overall system allows receiving data from within MATLAB and analyzing or plotting data in pseudo-real-time using MATLAB functions. The system is also useful to log data for performing simulations based on real logged data.
UART Tx-Matlab example:
This example uses picgui and Tx-Matlab blocks to plot three overlapping sine waves of different frequencies and amplitudes. Tx-Matlab block is setup to use three channels, one for each signal. The live value of each signal will be displayed in picgui.
Note: The signals displayed can have different sample rates.