Filter löschen
Filter löschen

Can you pass a bus containing a string into a vector concatenate block?

4 Ansichten (letzte 30 Tage)
I need to create a vector of the same bus so that the signal is of the bus type but dimensions of 8. One of the elements of the bus is a string. When I do this, I get the error that a bus with type string cannot be used with the vector concatenate block. Is there a different block or workaround so i can create a signal, typed by a bus, with a dimension greater than 1?

Antworten (1)

Shanmukha Voggu
Shanmukha Voggu am 31 Aug. 2021
Hi Mark,
To convert the bus containing a string and numerals as elements
1)give bus signal as input to bus selector block
2)double click on the bus and update it to divide the input signal into the numerals and string
3)use the vector concatenate for the numerals alone
refer to this for more information.
  1 Kommentar
Mark Marzotto
Mark Marzotto am 31 Aug. 2021
Bearbeitet: Mark Marzotto am 16 Sep. 2021
Thank you for the response, Shanmukha.
I am familiar with a bus selector block, but I need the output of the concatenate block to be of that bus type, but with a dimension greater than 1, so I need to pass the entire bus into the concatenate block, otherwise the output signal will not have the proper type.
For example, bus "BusA" has elements {value : Double} and {name : String}. I need a signal that is BusA{8}, or in other words, 8 instances of BusA concatenated together so the dimension of the signal is 8. If I only pass the value element in, then my signal is a double with dimension = 8, not BusA with dimension =8.

Melden Sie sich an, um zu kommentieren.

Produkte


Version

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by