comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » repeating elements of an array
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
repeating elements of an array [message #89347] Sun, 24 August 2014 09:42 Go to previous message
Cleo Drakos is currently offline  Cleo Drakos
Messages: 1
Registered: August 2014
Junior Member
Hi guys

First I want to arrange two values (-50 and 40) in the range of 10, so that I get the following array:

a = [-50 -40 -30 -20 -10 0 10 20 30 40]
Now, I want to repeat each element of array 5 times so that I can get the following result:

ans1 = [-50 -50 -50 -50 -50 -40 -40 ....40]

I also want to repeat the whole array 5 times to get the following result:

ans2 = [-50 -40 -30 -20 -10 0 10 20 30 40 -50 -40 -30 -20 -10 0 10 20 30 40 -50 -40 -30 -20 -10 0 10 20 30 40 -50 -40 -30 -20 -10 0 10 20 30 40 -50 -40 -30 -20 -10 0 10 20 30 40 .......]

How can I do it? I hope someone can help me.

cleo
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: CPU overload when saving a file
Next Topic: Add event handling to an ENVI display group

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Thu Oct 09 20:30:23 PDT 2025

Total time taken to generate the page: 0.00547 seconds