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

2 views (last 30 days)
Mark Marzotto
Mark Marzotto on 27 Aug 2021
Edited: Mark Marzotto on 16 Sep 2021
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?

Answers (1)

Shanmukha Voggu
Shanmukha Voggu on 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 Comment
Mark Marzotto
Mark Marzotto on 31 Aug 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.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!