help-octave
[Top][All Lists]

## Re: problem plotting "N-d object"

 From: Sergei Steshenko Subject: Re: problem plotting "N-d object" Date: Fri, 17 Feb 2012 10:35:37 -0800 (PST)

```>________________________________
> From: James Sherman Jr. <address@hidden>
>Sent: Friday, February 17, 2012 7:13 PM
>Subject: Re: problem plotting "N-d object"
>
>
>Because of my math background I find it senseless to say that a 3-d cube
>projection onto a 2-d plane is still 3-d - it is just 2-d, and, likewise, that
>2-d cube image of a cube on a plane being projected onto a 1-d straight line
>would be just 1-d.
>
>This isn't even a solid mathematical reason.  The image of a cube on a 2-d
>plane in R^3 is different than the image of a cube in R^2.  Or, in otherwords,
>the matrix transformations defined by the matrices A = [1 0 0;0 1 0;0 0 0] and
>A = [1 0 0;0 1 0] are different transformations (they have different codomains
>for one).
>
>
>But, I'd agree that for something like the plot function, it would make sense
>to apply squeeze ahead of time (I certainly can't think of any case where it'd
>make sense to not do squeeze), and for many projects, I have actually written
>a small wrapper around plot that does exactly that (and some otherstuff).
>
>
>But like Ben mentioned, its hard to anticipate where this may not prove
>useful, and probably would be best on a case-by-case basis to do something
>like this.
>
>
>Thats my 2 cents.
>
>
>James Sherman
>
>

I meant my high school geometry background.

Anyway, in 'octave':

"
octave:11> foo = [1 2 3; 4 5 6]
foo =

1   2   3
4   5   6

octave:12> size(foo(:, 1))
ans =

2   1

octave:13> size(foo(1, :))
ans =

1   3

octave:14> isvector(foo(:, 1))
ans =  1
octave:15> isvector(foo(1, :))
ans =  1
octave:16>

".

My point is that an originally 2-d object with any one of the two indexes
fixed/constant is perceived by 'octave' as 1-d object - either as row or column
vector, but as _vector_. Exactly as I expect.

And that's why I expected from 'octave' to perceive an originally 3-d object
with two fixed/constant indexes as 1-d vector. Probably as a column one because
I feel that overall 'octave' is friendlier to column vectors.

Thanks,
Sergei.

```