help-octave
[Top][All Lists]
Advanced

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

Re: toascii/abs


From: Daniel Heiserer
Subject: Re: toascii/abs
Date: Wed, 24 Mar 1999 07:16:12 +0100

John W. Eaton wrote:
> 
> On 23-Mar-1999, Daniel Heiserer <address@hidden> wrote:
> 
> | Hi,
> |
> | I have a problem with abs(a), if a is a string under octave.
> | In matlab that returns the ascii-values of the elements of a.
> |
> | In octave I have a feature 'toascii'.
> | Unfortunately I cannot edit the 'abs' function because it is a builtin.
> |
> | It would be nice if 'abs(a') would return what 'toascii(a)' returns
> | if 'a' is a string/stringmatrix.
> 
> Perhaps this is what you are looking for?
> 
>   octave:1> implicit_str_to_num_ok = 1
>   implicit_str_to_num_ok = 1
>   octave:2> abs ("foobar")
>   ans =
> 
>     102  111  111   98   97  114
> 
> It seems to me that abs() (i.e., absolute value) is a function that
> would apply to numbers, not strings.  Why not write your code to use
> toascii and then provide a simple wrapper function if you have to run
> your code in an environment that doesn't provide a suitable toascii
> function?

Guess what I did yesterday. ;-)

Anyway it's really good that octave provides lot of this 'mathematically
questionable, but
pragmatic and easy going' features of matlab. The thing is that I and
maybe some others 
don't know all of these details and that takes time to learn and wastes
capacity 
on both sides of the 'help-list' which 
could be better used to add new stuff. I know that there is ONE variable
which has to 
be set to set ALL matlab-compatible features (is that right?).
Unfortunately I didn't
find it in the documentation.


Thanks for your help and thanks for octave

bye daniel



reply via email to

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