Q:

Why Octave shows wrong dimension of this char array

I don't understand why this array:
Type = Reflective Event, Reflective Event, Reflective Event

according to Octave's variable editor is a 3x19 char array.
In the variable editor, Type is shown as follows (I don't know if that's helpful)
TYPE =

Reflective Event   
Reflective Event   
Reflective Event  

The thing is odd, in fact when I code disp(size(TYPE)) I get 3   19 accordingly.
Now, the even wierder thing is that, if I then code size(TYPE,1) which should give the size of TYPE's first dimension, I instead get 1   1.
Can you guys help me figure out what is wrong here?

A:

Just guessing, as the syntax in the post is invalid Octave:
Your variable is actually a matrix of chars. Note that a string is simply an array of independent chars. so
var1=" Reflective Event, ";

is a length(var1)==19 array, or a size(var1)==(1,19) array. Now, if you repeat that, you can either make a (1,19*3) array, or a (3,19) matrix, which I assume is what you have.
Now, as you did not know that each char is individual, you reached the wrong conclusion with your second test. When you index a matrix using linear indices (i.e. a single index), it will "unroll" the array and give you that single elements.
i.e. A=[1 2 3; 4 5 6; 7 8 9] is a 3x3 matrix, but you can do A(2,1) or just A(4) to access the value 4.
In your test size(TYPE(1)) is (1,1), because TYPE(1)==" ", as TYPE(3)=="e" and so on.

