thanks for the comment I certanly did not knew that A(:,[1 4 6]) will return columns 1, 4 and 6... but let's say that what I am looking for are the remaining columns from the original matrix A there fore what I want are columns 2, 3, 5...
On 19/07/2010, at 06:54 p.m., James Sherman Jr. wrote: On Mon, Jul 19, 2010 at 5:42 PM, insipido <address@hidden> wrote: hello I am trying to eliminate n columns on a matrix in an unsorted way. So far I've only been able to eliminate consecutive columns by using A(:, 2:4) which will eliminate columns 2, 3 and 4 out of a matrix A with more than 4 columns. can some one help or assist me here please, thanks.
I'm not sure what you mean by eliminate.
A(:, [2:4]) will return a matrix with columns 2, 3, and 4. But this is because 2:4 returns the vector [2 3 4]. So, if say you want to get columns 1, 4, and 6, you'd just do A(:, [1, 4, 6]). Or say you want the 6th column first for whatever reason, you'd do A(:, [6, 1, 4]). Hope this helps.
_______________________________________________ Help-octave mailing list address@hidden https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
|