Thread Subject: Array with increasing numbers of increment 1

Subject: Array with increasing numbers of increment 1

From: Herve

Date: 19 Dec, 2011 13:01:09

Message: 1 of 4

Hello,

I have a very simple question.

Is there a built-in function that creates an array such as

x = [1 2 3 4 5 6 .... n] with n a given positive integer.

Thanks.

Subject: Array with increasing numbers of increment 1

From: dpb

Date: 19 Dec, 2011 14:14:00

Message: 2 of 4

On 12/19/2011 7:01 AM, Herve wrote:
> Hello,
> I have a very simple question.
> Is there a built-in function that creates an array such as
> x = [1 2 3 4 5 6 .... n] with n a given positive integer.
> Thanks.

doc colon

--

Subject: Array with increasing numbers of increment 1

From: Matt J

Date: 19 Dec, 2011 21:06:08

Message: 3 of 4

"Herve" wrote in message <jcncik$184$1@newscl01ah.mathworks.com>...
> Hello,
>
> I have a very simple question.
>
> Is there a built-in function that creates an array such as
>
> x = [1 2 3 4 5 6 .... n] with n a given positive integer.
==============

x=1:n,

or

x=linspace(1,n,n)

Subject: Array with increasing numbers of increment 1

From: dpb

Date: 19 Dec, 2011 22:25:18

Message: 4 of 4

On 12/19/2011 3:06 PM, Matt J wrote:
> "Herve" wrote in message <jcncik$184$1@newscl01ah.mathworks.com>...
>> Hello,
>> I have a very simple question.
>> Is there a built-in function that creates an array such as
>> x = [1 2 3 4 5 6 .... n] with n a given positive integer.
> ==============
>
> x=1:n,
>
> or
> x=linspace(1,n,n)

or, variations on a theme...

x=colon(1,3)

:)

--

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

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.

rssFeed for this Thread

Contact us at files@mathworks.com