help-octave
[Top][All Lists]
Advanced

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

Re: Excluding elements of a matrix (Joseph Wakeling)


From: Alexander Barth
Subject: Re: Excluding elements of a matrix (Joseph Wakeling)
Date: Thu, 21 Dec 2006 10:19:49 -0500
User-agent: Thunderbird 1.5.0.7 (X11/20060913)

An alternative way, is to do

octave:2> A = magic(4)
A =

   16    2    3   13
    5   11   10    8
    9    7    6   12
    4   14   15    1

octave:3> A(1:end ~= 2,:)
ans =

   16    2    3   13
    9    7    6   12
    4   14   15    1

Works in octave 2.9.9 and matlab.

cheers,
Alex


Joseph Wakeling wrote:
> John W. Eaton wrote:
>> You can, but it is not necessary.  If k == 1, then the first
>> expression is 1:0, or [](1x0).  If k == columns(a), then the second
>> expression is k+1:k, or [](1x0), so it just works.
> 
> Aah, very nice.  Thanks for the correction.  That makes things much easier.
> 
> I still think the "excluding" notation would be a nice idea though. :-)
> 
> 
> _______________________________________________
> Help-octave mailing list
> address@hidden
> https://www.cae.wisc.edu/mailman/listinfo/help-octave
> 


-- 
_______________________________________________________________

  Alexander Barth

  Ocean Circulation Group
  University of South Florida
  College of Marine Science
  140 Seventh Avenue South
  St. Petersburg, Florida  33701
  USA

  Phone: +1-727-553-3508     FAX:   +1-727-553-1189

_______________________________________________________________


reply via email to

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