help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: column elimination


From: Vic Norton
Subject: Re: column elimination
Date: Mon, 19 Jul 2010 21:12:23 -0400

How about this:

X = rand(5, 8)
I = [1:8](rand(1, 8) > 0.5)  # eliminate these columns of X
X(:, I) = []

Regards,

Vic

On Jul 19, 2010, at 6:48 PM, Victor Carreto Pavon wrote:

> yes... that is right; I want all the columns except 1 and 4 in this case, but 
> maybe in the next case I might not want all the columns except 3 and 5. then 
> the notation A(:,[2,3,5:cols]) will no longer be useful. 
> 
> Do you know can I make it generic so it will work for any combination?
> 
> and thanks for answering. 
> 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]