octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

permute of a scalar


From: David Bateman
Subject: permute of a scalar
Date: Thu, 22 Apr 2004 19:10:27 +0200
User-agent: Mutt/1.4.1i

If 

a=1; b = a'; 

is legal, then I think so should be

a=1; permute(a,[2,1]);

that effectively does the same thing. However, as permute is not
defined for scalar values we get a gripe_wrong_type_arg. The patch
below adds the permute function for scalars. However, it doesn't check
the validity of the arguments and just returns the scalar value
itself. The Matlab version does check the indexing vector when called
with scalars, but this doesn't make all that much sense.

Cheers
David

-- 
David Bateman                                address@hidden
Motorola CRM                                 +33 1 69 35 48 04 (Ph) 
Parc Les Algorithmes, Commune de St Aubin    +33 1 69 35 77 01 (Fax) 
91193 Gif-Sur-Yvette FRANCE

The information contained in this communication has been classified as: 

[x] General Business Information 
[ ] Motorola Internal Use Only 
[ ] Motorola Confidential Proprietary

Attachment: patch.permute
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]