필터 지우기
필터 지우기

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

조회 수: 4 (최근 30일)
Mark Marzotto
Mark Marzotto 2021년 8월 27일
편집: Mark Marzotto 2021년 9월 16일
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?

답변 (1개)

Shanmukha Voggu
Shanmukha Voggu 2021년 8월 31일
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
Mark Marzotto
Mark Marzotto 2021년 8월 31일
편집: Mark Marzotto 2021년 9월 16일
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.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Sources에 대해 자세히 알아보기

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by