Discover MakerZone

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

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

New to MATLAB?

Putting buffer into 2 dimensional array ?

Asked by I Made

I Made (view profile)

on 10 Mar 2013

As example i have :

    frame=buffer(x,3);

and take example it's output < 3 x 2 int16 >

1 2

3 4

5 6

and i want to store it in array two dimension like :

A = [1 2 3; 4 5 6;]

how can i do that ?

0 Comments

I Made

I Made (view profile)

Products

No products are associated with this question.

2 Answers

Answer by the cyclist

the cyclist (view profile)

on 10 Mar 2013

I don't fully understand your question, especially because your A matrix has different values from your other matrix. But, it sounds like maybe what you are looking for can be done with the reshape() command.

If not, can you please supply some more details?

0 Comments

the cyclist

the cyclist (view profile)

Answer by Matt J

Matt J (view profile)

on 10 Mar 2013
 A=reshape(frame.',3,2).';

0 Comments

Matt J

Matt J (view profile)

Contact us