Valery Pipin wrote:
>Hello,
>On Monday 25 October 2004 16:36, Kamaraju Kusumanchi wrote:
>
>
>>Hi
>> Could someone help me with the following simple problem. I cannot
>>figure out where I should look for in the documentation regarding this.
>>Tried reading the documentation on array, functions etc., But none of
>>them talk about how to declare an 'elemental function'.
>>
>>I want to declare an array whose values are
>>
>>cos(%PI/N), cos(2*%PI/N), cos(3*%PI/N) ..... cos(N*%PI/N)
>>
>>I tried this
>>
>>i : [1,2,3,4,5,6,7,....,N]
>>
>>
>Perhaps the following will help. Look at describe(makelist) or describe(map).
>makelist(cos(i*%pi/10),i,1,10) or alternatively
>map(cos,[1,2,3,4,5,6,7,....,N]*%pi/N) where N is fixed
>
>rgds,
>Valery
>
>
Thanks for the reply. makelist is the function I am looking for. Is
there any to specify the increment. For example if I want an array whose
values are
cos(%PI/N), cos(%PI*4/N), cos(%PI*7/N) ....
I saw the help for makelist. It does not allow for specification of
increment. Any other ideas?
I can achieve this using map but makelist construction looks more
compact and does not involve listing all the numbers by myself.
any ideas?
thanks
raju