# "Roll My Own" Integrator Block for Multiple Signals

Is it possible to create a user-defined block in Simulink (and, later, XCos) that accepts a variable number of signals (I anticipate working with mainly 12 signals but not necessarily that number of signals) and outputs the integral of all the signals? The signals will be a vector from a $$Ax + Bu$$ signal, where $$x$$ is a state vector and $$u$$ is usually a 1D unit step function.

This is an example with 3 signals http://airvigilante194.sdf.org/Scripts/deadbeatJeff.slx I would prefer not to split the signals, integrate each of them separately, then recombine them.

(Also, if someone knows a way to quantize all the signals without splitting, quantizing individually, then recombining, that'd be great, but that may be a post for another day.)

• By varying, do you mean varying from one run of the simulation to the next or will the number of signals vary dynamically during the simulation run ?
– AJN
Sep 15 at 11:54
• Matlab-Simulink integrator block already has the ability to integrate multidimensional signals without splitting them. input : Port_1 — Integrand signal : real scalar or array.
– AJN
Sep 15 at 11:54
• @AJN Varying from one run of the simulation to the next - as I change A, B, C, and K between runs Sep 15 at 16:08
• @AJN That's the best news I've heard all day! I'll look into that tonight and hopefully have my simulator up and running with a Jacobian matrix of a critical point of a somewhat real vector field tomorrow. Sep 15 at 16:11