Overview

We make a system interesting by adding processes to it. The bindings allow processes to be added directly only to the root of a system (i.e. not directly to a Subsystem).

Procedure

  • Choose the type of Process to add, indicated by its SystemML class.
  • Design the parameters of the new Process, and construct a state structure to hold them (for details of the parameters a Process requires, see the documentation for each individual Process - they're all different).
  • Choose the sample rate at which the Process will execute.
  • Add the process to the system.
  • Call brahms to execute the system.

Example

Script

This example, along with the others in this section, can be found in the script developing_systems.m in the support/tutorial/system/matlab folder.

M Source Code (against 995)
% section header disp([10 '=== Add Process ===' 10]) % choose the class of a new process cls = 'std/2009/source/numeric'; % design the parameters of the new process state = []; state.data = 1:10; state.repeat = false; % choose its sample rate (Hz) fS = 10; % add process to the system using these parameters sys = sys.addprocess('src', cls, fS, state); % view the non-empty system sys % execute the system out = brahms(sys, exe); % view the system outputs out

Expected Output

Matlab Console
=== Add Process === -------------------------------- SystemML System -------------------------------- ['untitled'] "src" (std/2009/source/numeric) -------------------------------- out = 1x1 struct array with no fields.