vectors to scalars with an Embedded Matlab Function

1 visualización (últimos 30 días)
Owen
Owen el 15 de Nov. de 2012
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

Respuesta aceptada

Kaustubha Govind
Kaustubha Govind el 15 de Nov. de 2012
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 comentarios
Owen
Owen el 15 de Nov. de 2012
What about Level-2 S Function?
Senmeis
Kaustubha Govind
Kaustubha Govind el 15 de Nov. de 2012
Sure, you have a lot of flexibility with S-functions, so you should be able to use them too.

Iniciar sesión para comentar.

Más respuestas (2)

Azzi Abdelmalek
Azzi Abdelmalek el 16 de Nov. de 2012
Editada: Azzi Abdelmalek el 16 de Nov. de 2012
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 comentarios
Azzi Abdelmalek
Azzi Abdelmalek el 19 de Nov. de 2012
Editada: Azzi Abdelmalek el 19 de Nov. de 2012
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 el 19 de Nov. de 2012
Azzi: I didn't recommend Demux block originally because Owen wants to effectively "upsample" (or Unbuffer) the signal.

Iniciar sesión para comentar.


Owen
Owen el 21 de Nov. de 2012
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

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by