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$>
References: <hp7okq$j63$>
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:; posting-host="/1A9iacjOhUxfY+DU0Yucg";
	logging-data="25271"; mail-complaints-to="";	posting-account="U2FsdGVkX18BzaiuGNZCyMis4LxEADyN"
User-Agent: Thunderbird (Windows/20090812)
In-Reply-To: <HIDDEN>
Cancel-Lock: sha1:dKc3jr53nF8/DJ3m5FYnxj7gyPw=
Xref: 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.