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 vector of numbers in range F:L with n numbers at each point

Subject: Creating vector of numbers in range F:L with n numbers at each point

From: Ulrik Nash

Date: 2 Nov, 2011 15:43:12

Message: 1 of 3

Hi Everyone,

Is there not an easy way to create a vector, with numbers from 1:10, say, with 5 1's, 5'2 ... 5 10's?

Regards,

Ulrik

Subject: Creating vector of numbers in range F:L with n numbers at each point

From: Anh Huy Phan

Date: 2 Nov, 2011 16:13:09

Message: 2 of 3

"Ulrik Nash" <uwn@sam.sdu.dk> wrote in message <j8roeg$lc8$1@newscl01ah.mathworks.com>...
> Hi Everyone,
>
> Is there not an easy way to create a vector, with numbers from 1:10, say, with 5 1's, 5'2 ... 5 10's?
>
> Regards,
>
> Ulrik

kron(1:10,ones(1,5))

Huy Phan

Subject: Creating vector of numbers in range F:L with n numbers at each point

From: Jomar Bueyes

Date: 2 Nov, 2011 16:17:31

Message: 3 of 3

On Nov 2, 11:43 am, "Ulrik Nash" <u...@sam.sdu.dk> wrote:
> Hi Everyone,
>
> Is there not an easy way to create a vector, with numbers from 1:10, say, with 5 1's, 5'2 ... 5 10's?
>
> Regards,
>
> Ulrik

Hi Ulrik,

Is there a particular ordering you want? If not, have you tried
repmat?

>> v = repmat((1:10), 1, 5);

HTH

Jomar

Tags for 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