From: someone on 28 Apr 2010 11:49 "Kai " <kai.voges.nospam(a)gmx.net> wrote in message <hr9kot$mhf$1(a)fred.mathworks.com>... > Hello, > > I have a basic problem here, I am trying to solve for hours now. Here it comes: > A = ones(100, 4) > b = [23 30 60] > > Now I want to remove the rows specified in b from A with logical indexing. > For a row vector, like A=ones(100, 1) it is clear that: > A = A(A~=b); > removes the specified rows. But how does it work for a matrix? I tried this: > > A = A(A~=b, :) and some others; without success. > % How about A = ones(100, 4); b = [23 30 60]; A(b,:) = []; size(A) ans = 97 4 > Can someone provide me with the correct expression. > > Thanks in advance, > Kai
|
Pages: 1 Prev: Removing multiple rows from matrix Next: OLS problem with non-linear constraint |