Path: news.mathworks.com!newsfeed-00.mathworks.com!kanaga.switch.ch!switch.ch!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsfeed.straub-nv.de!feeder.eternal-september.org!eternal-september.org!.POSTED!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Removing indices from a vector
Date: Sat, 03 Apr 2010 11:13:26 -0500
Organization: A noiseless patient Spider
Lines: 30
Message-ID: <hp7phi$oln$1@news.eternal-september.org>
References: <hp7okq$j63$1@fred.mathworks.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 3 Apr 2010 16:14:43 +0000 (UTC)
Injection-Info: mx01.eternal-september.org; posting-host="/1A9iacjOhUxfY+DU0Yucg";
	logging-data="25271"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX18BzaiuGNZCyMis4LxEADyN"
User-Agent: Thunderbird 2.0.0.23 (Windows/20090812)
In-Reply-To: <HIDDEN>
Cancel-Lock: sha1:dKc3jr53nF8/DJ3m5FYnxj7gyPw=
Xref: news.mathworks.com comp.soft-sys.matlab:623183

Eamonn B wrote:
> I have a vector set up  like this
> a = [[5 2 1 4 8]' [6 3 10 3 -5]']; % [x] [y]
> 
> I want to delete the x and y at the same time
> 
> I am able to show the two indices by doing this
> [a(2,1) a(2,2)]
> 
> I try and delete them by doing this [a(2,1) a(2,2)]=[]
> I get this error
> 'Too many output arguments.'
> 
> I have also tried this way
> z=[a(2,1) a(2,2)]
> a(z)=[]
> it works a=1     5     8    10     3     3     6    -5
> but it removes the columns thus putting the x and y together which is 
> not what I want.
> 
> Anyone know how I can remove the value but still keeping the columns?

The problem in general is that if you try to remove 
more-or-less-randomly placed elements in an array, the array is no 
longer square--hence the result above of a vector returned.

You could set elements to zero but to make them null either would 
require a cell array or regularizing the elements to be eliminated.

--