octave-maintainers
[Top][All Lists]
Advanced

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

Re: goals for 3.1


From: David Bateman
Subject: Re: goals for 3.1
Date: Thu, 20 Mar 2008 17:03:02 +0100
User-agent: Thunderbird 2.0.0.12 (X11/20080306)

John W. Eaton wrote:
> | Are there any other functions I missed? Are there any additional tests
> | that might be useful?
>
> I'm not sure about additional fucntions but in addition to working on
> numeric data, these functionns should also work on character, struct,
> and cell arrays.
>   
cell and struct arrays might need a little thought to add them.
character arrays are easy, however the "cast" function needs to support
the "char" type which it currently doesn't (but does in matlabR2007b)..
Changeset attached. I'll look at adding the addition types to check to
the test code.

D.


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

The information contained in this communication has been classified as: 

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

# HG changeset patch
# User David Bateman <address@hidden>
# Date 1206028815 -3600
# Node ID 88e8a93c06b1177cf162c1bc6467c0726f03ac0c
# Parent  7e0a02a8f6118721112b29966b5ddfd2a9ac4bfc
Allow cast to 'char'.

diff --git a/scripts/ChangeLog b/scripts/ChangeLog
--- a/scripts/ChangeLog
+++ b/scripts/ChangeLog
@@ -1,4 +1,6 @@ 2008-03-20  David Bateman  <address@hidden
 2008-03-20  David Bateman  <address@hidden>
+
+       * miscellaneous/cast.m: Also allow cast to "char".
 
        * general/rotdim.m: Ensure k is an integer scale.
 
diff --git a/scripts/miscellaneous/cast.m b/scripts/miscellaneous/cast.m
--- a/scripts/miscellaneous/cast.m
+++ b/scripts/miscellaneous/cast.m
@@ -30,7 +30,7 @@ function retval = cast (val, typ)
     if (ischar (typ))
       if (any (strcmp (typ, {"int8"; "uint8"; "int16"; "uint16";
                             "int32"; "uint32"; "int64"; "uint64";
-                            "double"; "single"; "logical"})))
+                            "double"; "single"; "logical"; "char"})))
        retval = feval (typ, val);
       else
        error ("cast: type name `%s' is not a built-in type", typ);

reply via email to

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