vectors to scalars with an Embedded Matlab Function

1 次查看(过去 30 天)
Hello,
can anyone show me how to convert a 10x1 vector into 10 scalars with an Embedded Matlab Function?
I just don't know how to upsample the incoming vector, that is, the sample frequency at the output must be 10 times greater than at the input.
Thanks Senmeis

采纳的回答

Kaustubha Govind
Kaustubha Govind 2012-11-15
Are you attempting to use the Embedded MATLAB Function block to perform upsampling? If so, I don't think that is possible, because the Embedded MATLAB Function block runs at an "inherited" sample-time, which means that the output must have the same sample rate as the input. It looks like what you really need is an Unbuffer block.
  2 个评论
Kaustubha Govind
Kaustubha Govind 2012-11-15
Sure, you have a lot of flexibility with S-functions, so you should be able to use them too.

请先登录,再进行评论。

更多回答(2 个)

Azzi Abdelmalek
Azzi Abdelmalek 2012-11-16
编辑:Azzi Abdelmalek 2012-11-16
You can use a Demux block from Simulink/Signal Routing. At the output of Demux you will have 10 scalar at the same time. If you want them one after one, add an Index Vector block.
  5 个评论
Azzi Abdelmalek
Azzi Abdelmalek 2012-11-19
编辑:Azzi Abdelmalek 2012-11-19
Ah, I did'nt understand, I confused with variable step size. Then try Kaustubha's suggestion, you will need a communication system toolbox
Kaustubha Govind
Kaustubha Govind 2012-11-19
Azzi: I didn't recommend Demux block originally because Owen wants to effectively "upsample" (or Unbuffer) the signal.

请先登录,再进行评论。


Owen
Owen 2012-11-21
I've made it with an Embedded Matlab Function. For the sample time for each element I use the Repeating Sequence Stair block. Thank you anyway.
Senmeis

类别

Help CenterFile Exchange 中查找有关 String 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by