First time here? Check out the FAQ!

Ask Your Question
0

Create a periodic vector/array

asked 9 years ago

Erel Segal-Halevi gravatar image

What is the quickest way to create an array of length 999 such as the following:

[0, 2, 7, 0, 2, 7, 0, 2, 7, ...]

?

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
1

answered 9 years ago

FrédéricC gravatar image

[0,2,7]*333

Preview: (hide)
link

Comments

So simple! Thanks.

Erel Segal-Halevi gravatar imageErel Segal-Halevi ( 9 years ago )

Yup! Learning a bit of Python will go a long way with Sage; there are a number of great tutorials out there.

kcrisman gravatar imagekcrisman ( 9 years ago )

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 9 years ago

Seen: 776 times

Last updated: Nov 11 '15