Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!news1.google.com!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post02.iad.highwinds-media.com!newsfe10.iad.POSTED!7564ea0f!not-for-mail
From: Walter Roberson <roberson@hushmail.com>
User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.5; en-US; rv:1.9.2.8) Gecko/20100802 Thunderbird/3.1.2
MIME-Version: 1.0
Newsgroups: comp.soft-sys.matlab
Subject: Re: Speeding up removal of zero columns
References: <i5ecr3$bof$1@fred.mathworks.com> <i5egj6$8tb$1@fred.mathworks.com>
In-Reply-To: <i5egj6$8tb$1@fred.mathworks.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 10
Message-ID: <vmAeo.2095$rC7.209@newsfe10.iad>
NNTP-Posting-Host: 24.79.143.47
X-Complaints-To: internet.abuse@sjrb.ca
X-Trace: newsfe10.iad 1283117595 24.79.143.47 (Sun, 29 Aug 2010 21:33:15 UTC)
NNTP-Posting-Date: Sun, 29 Aug 2010 21:33:15 UTC
Date: Sun, 29 Aug 2010 16:33:14 -0500
Xref: news.mathworks.com comp.soft-sys.matlab:665977

On 29/08/10 3:40 PM, Roger Stafford wrote:
> "Kurt " <jef_kabouter_wesley@hotmail.com> wrote in message
> <i5ecr3$bof$1@fred.mathworks.com>...

>> routes2=routes2(:,any(routes2));

> As your code is now, every element of every column must be tested.

No, any() and all both short-circuit; this can be demonstrated with some 
simple timing tests on larger arrays.