For complex vectors I would expect from Arie

   en =: |@j.&|/"1
   ]zz =: 2 2 $ 1j1 1j1 1j2 4j10
1j1  1j1
1j2 4j10
   en zz  NB. norms of vectors 1j1 1j1 and 1j2 4j10
2 11
   # ;: 5!:5 <'en'  NB. Number of words in linear representation
8

(Euclidian norm of complex vector is square root of sum of squares of absolute 
values of components.)

--Kip

Sent from my iPad

> On Dec 16, 2013, at 6:42 AM, Aai <[email protected]> wrote:
> 
>   |@j./"1 yy
> 5 13
> 17 25
> 
> 
>> On 16-12-13 04:38, km wrote:
>> This is an easy one, but let's see what you come up with.
>> 
>> The Euclidian norm or length of a vector is the square root of the sum of 
>> the squares of its components.  Write verb  en  below.  It should be able to 
>> find the length of a vector of any number of components.
>> 
>>    ]yy =: 2 2 2 $ 3 4 5 12 8 15 7 24
>> 3  4
>> 5 12
>> 
>> 8 15
>> 7 24
>>    en yy  NB. lengths of 3 4 and 5 12 and 8 15 and 7 24
>>  5 13
>> 17 25
>> 
>> -- Kip Murray
>> 
>> Sent from my iPad
>> ----------------------------------------------------------------------
>> For information about J forums see http://www.jsoftware.com/forums.htm
> 
> -- 
> Met vriendelijke groet,
> @@i = Arie Groeneveld
> 
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to