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

Thread Subject:
Creating a vector from sub vector

Subject: Creating a vector from sub vector

From: Jal

Date: 23 May, 2010 18:51:03

Message: 1 of 3

Hi all,
I have a 3x1 column vector and I want to build a column vector of size (n).
Example:-
Assume
          a=[1+j*0 ; -0.5000 -j*0.8660 ; -0.5000 + j*0.8660]

How can I build a column vector say (b) of size (n=12) form vector (a)?
vector b should look like:
         b=[1+j*0
              -0.5000 -j*0.8660
             -0.5000 + j*0.8660
               1+j*0
              -0.5000 -j*0.8660
             -0.5000 + j*0.8660
              1+j*0
              -0.5000 -j*0.8660
             -0.5000 + j*0.8660
              1+j*0
              -0.5000 -j*0.8660
             -0.5000 + j*0.8660];

Subject: Creating a vector from sub vector

From: Matt Fig

Date: 23 May, 2010 18:59:05

Message: 2 of 3

See the help for the REPMAT function.

Subject: Creating a vector from sub vector

From: Roger Stafford

Date: 23 May, 2010 19:05:06

Message: 3 of 3

"Jal" <jal@mathworks.com> wrote in message <htbten$51q$1@fred.mathworks.com>...
> Hi all,
> I have a 3x1 column vector and I want to build a column vector of size (n).
> Example:-
> Assume
> a=[1+j*0 ; -0.5000 -j*0.8660 ; -0.5000 + j*0.8660]
>
> How can I build a column vector say (b) of size (n=12) form vector (a)?
> vector b should look like:
> b=[1+j*0
> -0.5000 -j*0.8660
> -0.5000 + j*0.8660
> 1+j*0
> -0.5000 -j*0.8660
> -0.5000 + j*0.8660
> 1+j*0
> -0.5000 -j*0.8660
> -0.5000 + j*0.8660
> 1+j*0
> -0.5000 -j*0.8660
> -0.5000 + j*0.8660];

  You need matlab's 'repmat'. Check it out.

Roger Stafford

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us