help-octave
[Top][All Lists]
Advanced

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

Re: is this a bug?


From: Mirek Kwasniak
Subject: Re: is this a bug?
Date: Sun, 6 Jul 1997 19:23:06 +0200 (CEST)

> > The following is what I did with octave-2.0.8 on Linux
> > 
> > z = [
> >    1       0       0
> >    1       0       0
> >    0       1       0
> >    0       1       0
> >    0       0       1
> >    0       0       1
> > ];
> > 
> > z(:, any(z))
> > 
> > ans =
> > 
> >   1  1  1
> >   1  1  1
> >   0  0  0
> >   0  0  0
> >   0  0  0
> >   0  0  0
> > 
> > Vu Nguyen-Cong
> > address@hidden
> >
> > 
> > If you set prefer_zero_one_indexing to 1, Octave will return the
> > original matrix for this example.  Is that what you were expecting?
> > 
> > The next major release of Octave will have a boolean type that will
> > eliminate this ambiguity and the need for the prefer_zero_one_indexing
> > variable.
> > 
> > jwe
> 
> Thank you indeed for your help.
> Regards,
> Vu Nguyen-Cong
> 

Matlab (and Octave) compatybile solution is:

                  z(:,find(any(z)))

Mirek



reply via email to

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