help-octave
[Top][All Lists]
Advanced

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

Re: fields not found in struct because of 'µ' (micr o) symbol in field n


From: Andy Buckle
Subject: Re: fields not found in struct because of 'µ' (micr o) symbol in field name
Date: Tue, 26 Apr 2011 10:45:06 +0100

On Tue, Apr 26, 2011 at 10:25 AM, kloof <address@hidden> wrote:
> In 2006 there was a discussion on "Accepting arbitrary strings as structure
> field names":
> https://mailman.cae.wisc.edu/pipermail/octave-maintainers/2006-November/005040.html
>
> but this does not concern 'composed' characters like 'µ', I think, but
> standard ascii symbols like '#', which are represented as 1 instead of 2
> ascii integers.
>
> Below I have a string hdr{27} that contains a 'µ' symbol.
>
> octave:4> hdr{27}
> ans = Delay M2 [µs]     0
>
> octave:5> toascii ("#")
> ans =  35
> octave:6> toascii ("µ")
> ans =
>
>   66   53
>
>
> octave:7> toascii (hdr{27})
> ans =
>
>  Columns 1 through 13:
>
>    68   101   108    97   121    32    77    50    32    91    53   115
> 93
>
>  Columns 14 and 15:
>
>     9    48
>
> octave:8>
>
> Again: on command line nr 6, I have pasted the 'µ' symbol using the mouse.
> The code [66 53] does not appear in the translation of the string hdr{27}.
>
> This means I cannot even replace or remove such characters in Octave, right?
> How can I tackle this problem?

I had a problem using text from a file as variable names. I stripped
all non alphanumeric chars like this

var((var<'a' | var>'z') & (var<'A' | var>'Z') & (var<'0' | var>'9'))=[];

Does this work for you? (It is a shame that the mu is not replaced
with micro or something)

-- 
/* andy buckle */


reply via email to

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