help-octave
[Top][All Lists]
Advanced

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

Re: [foo{:}] - feature or bug ? (octave-3.4.2)


From: James Sherman Jr.
Subject: Re: [foo{:}] - feature or bug ? (octave-3.4.2)
Date: Sat, 6 Aug 2011 08:32:27 -0400


I do _not_ see any trace of "[1 2 3 4]" vector ?


You do see a trace in the fact that there is emptiness there (not simply out of bounds).  The problem is that octave matrices (AFAIK) can only hold one type of element.  So, when you concatenate a char matrix with a double matrix, I believe octave defaults to a char matrix.  I'm using 3.2.4 still, but this is what I get for concatenation:

octave-3.2.4.exe:20> a = "a"
a = a
octave-3.2.4.exe:21> b = [1 2 3 4]
b =

   1   2   3   4

octave-3.2.4.exe:22> c = [a b]
c = a☺☻♥♦

So the b variable is interpreted in funny characters (presumably corresponding to 1 2 3 4 in whatever encoding octave is using).
You can see this in the whos:
octave-3.2.4.exe:26> whos
Variables in the current scope:

  Attr Name        Size                          Bytes  Class
  ==== ====        ====                     =====  =====
       a                   1x1                          1        char
       b                   1x4                         32       double
       c                   1x5                          5        char

So the reason you're seeing emptiness is probably because whatever in coding your using for characters, the corresponding characters for the numbers 1, 2, 3 and 4 are blank or maybe unprintable.

Hope this helps.

reply via email to

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