Is there an elegan "Matlb" way to do math on all the signals in a bus, ie add element by element the signals

I'm trying to do simple math on bus signals. Do I have to extract them from the bus and do the math on each signal, or can I do the math en-masse on the whole bus?

Answers (1)

I guess you are talk about Simulink. The answer is no. This is one of the difference between bus signal and vector signal. If you combine several scalar signal into a vector signal using Mux block, you can do the math operation on the vector signal. But you usually can't do the same on bus signal, as the bus signal might contain bus signal hierarchy and can contain different types of signals.

This question is closed.

Asked:

on 11 Nov 2011

Closed:

on 20 Aug 2021

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!