Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!news2.google.com!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post02.iad.highwinds-media.com!newsfe08.iad.POSTED!7564ea0f!not-for-mail
From: Walter Roberson <roberson@hushmail.com>
Organization: Canada Eat The Cookie Foundation
User-Agent: Thunderbird 2.0.0.18 (Windows/20081105)
MIME-Version: 1.0
Newsgroups: comp.soft-sys.matlab
Subject: Re: Omitting certain lines with 'textscan'
References: <ggcb3h$k5k$1@fred.mathworks.com>
In-Reply-To: <ggcb3h$k5k$1@fred.mathworks.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 21
Message-ID: <iJiWk.4581$X11.209@newsfe08.iad>
NNTP-Posting-Host: 24.79.146.116
X-Complaints-To: internet.abuse@sjrb.ca
X-Trace: newsfe08.iad 1227470798 24.79.146.116 (Sun, 23 Nov 2008 20:06:38 UTC)
NNTP-Posting-Date: Sun, 23 Nov 2008 20:06:38 UTC
Date: Sun, 23 Nov 2008 14:07:10 -0600
Xref: news.mathworks.com comp.soft-sys.matlab:502672


Ryan Utz wrote:
> Sometimes, however, when the data are erroneous the final field (flow) is listed as
> a negative number. I'd like to just omit any and all data when this is the case,
> in other words, I don't even want the dates for erroneous data to be imported. Is there
> a clean way in 'textscan' to specify when to ignore a particular line when it involves
> just one field?

Sorry, no.

> If not, anyone have any post-import ideas?

A(A(:,end) < 0),:) = [];

The above will delete all rows of A in which the last column is less than 0.


-- 
.signature note: I am now avoiding replying to unclear or ambiguous postings.
Please review questions before posting them. Be specific. Use examples of what you mean,
of what you don't mean. Specify boundary conditions, and data classes and value
relationships -- what if we scrambled your data or used -Inf, NaN, or complex(rand,rand)?