vectors to scalars with an Embedded Matlab Function

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일

0 개 추천

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

Owen
Owen 2012년 11월 15일
What about Level-2 S Function?
Senmeis
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일

0 개 추천

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

Owen
Owen 2012년 11월 17일
Thank you. You are really an expert in Simulink. I'll try it later and report my result.
Do you think this method works for variable-sized vectors? I noticed there are many limits on variable-sized data so variable-sized data cannot be processed as fixed-sized data in many situations.
Thanks Senmeis
Yes it works
Owen
Owen 2012년 11월 19일
I've tried Demux block and I'm afraid it cannot be used with variable-sized data.
Senmeis
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
Azzi: I didn't recommend Demux block originally because Owen wants to effectively "upsample" (or Unbuffer) the signal.

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

Owen
Owen 2012년 11월 21일

0 개 추천

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

카테고리

제품

질문:

2012년 11월 15일

Community Treasure Hunt

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

Start Hunting!

Translated by