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.