Asked by hadi
on 13 Nov 2012

I need to convert a raw matrix into a sequence of digits (single element matrices)using simulink block that gives one element at a time because I am using (Integer to binary converter) that gives me 1x8 matrix and I need to transmit those binary digits one by one through a communication channel..

Answer by Azzi Abdelmalek
on 13 Nov 2012

Edited by Azzi Abdelmalek
on 16 Nov 2012

Accepted Answer

You can use an Index Vector block with 8 input, the control input is a repeating sequence stair [0 1 2 3 4 5 6 7] block. If it's not clear I will post a simulink model

hadi
on 13 Nov 2012

thank Azzi for your help but please post me the simulink model to understand your your answer.

hadi
on 13 Nov 2012

thank you Azzi really thank you am really appreciate it ..I think the output for your model is 1 then 0 then 0 1 1 0 1 1 isn't it?

Azzi Abdelmalek
on 13 Nov 2012

yes, is'nt what you want?

Log in to comment.

Related Content

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn moreOpportunities for recent engineering grads.

Apply Today
## 6 Comments

## Walter Roberson (view profile)

Direct link to this comment:https://www.mathworks.com/matlabcentral/answers/53615-how-can-i-convert-a-raw-matrix-into-a-sequence-of-digits#comment_110987

Are you looking to convert numbers into decimal digits and then you will later convert the decimal digits to binary? Or are you looking to convert the numbers directly to binary?

Will these numbers be integral, or will they contain fractions as well? Will the numbers always be non-negative?

## hadi (view profile)

Direct link to this comment:https://www.mathworks.com/matlabcentral/answers/53615-how-can-i-convert-a-raw-matrix-into-a-sequence-of-digits#comment_110989

I have a continuous sine wave ,I inserted it into a (Uniform Encoder) block then the output of that block is the input of the (Integer to binary converter) block which gives me a raw matrix 1x8 .

## Azzi Abdelmalek (view profile)

Direct link to this comment:https://www.mathworks.com/matlabcentral/answers/53615-how-can-i-convert-a-raw-matrix-into-a-sequence-of-digits#comment_110990

What is your maximum integer number, 256?

## hadi (view profile)

Direct link to this comment:https://www.mathworks.com/matlabcentral/answers/53615-how-can-i-convert-a-raw-matrix-into-a-sequence-of-digits#comment_110991

yes.

## hadi (view profile)

Direct link to this comment:https://www.mathworks.com/matlabcentral/answers/53615-how-can-i-convert-a-raw-matrix-into-a-sequence-of-digits#comment_110992

I think if there is a Parallel to Serial converter block then the problem will be solved? thanks for your help.

## Nazim Mohamed (view profile)

Direct link to this comment:https://www.mathworks.com/matlabcentral/answers/53615-how-can-i-convert-a-raw-matrix-into-a-sequence-of-digits#comment_266533

Hello, is it possible to run the simulation in 'inf' and modify the constant value while simulation ?

Log in to comment.