From: Benedikt Heudorfer on
Hi everyone,

my question might sound stupid but I couldn't figure it out...
I have extracted date out of a .txt file. However there is some data that is invalid (represented by a -9999 entry). I want to make a graph out of this data, but I want to cut out the invalid data (the -9999s). Is there a way to set every data <0 = NaN so it won't be displayed in the graph?
From: Frédéric Bergeron on
"Benedikt Heudorfer" <rawker_(a)web.de> wrote in message <hur37s$nho$1(a)fred.mathworks.com>...
> Hi everyone,
>
> my question might sound stupid but I couldn't figure it out...
> I have extracted date out of a .txt file. However there is some data that is invalid (represented by a -9999 entry). I want to make a graph out of this data, but I want to cut out the invalid data (the -9999s). Is there a way to set every data <0 = NaN so it won't be displayed in the graph?

Maybe try this:
data(data<0)=NaN
It index your data basing on the logical array data<0.
Hope it helps!
From: dpb on
Benedikt Heudorfer wrote:
....

> Is there a way to set every data <0 = NaN ...

x(x<0)=nan;

--
From: Benedikt Heudorfer on
"Frédéric Bergeron" <frederic.bergeron(a)logiag.com> wrote in message <hur3sk$6rn$1(a)fred.mathworks.com>...
> "Benedikt Heudorfer" <rawker_(a)web.de> wrote in message <hur37s$nho$1(a)fred.mathworks.com>...
> > Hi everyone,
> >
> > my question might sound stupid but I couldn't figure it out...
> > I have extracted date out of a .txt file. However there is some data that is invalid (represented by a -9999 entry). I want to make a graph out of this data, but I want to cut out the invalid data (the -9999s). Is there a way to set every data <0 = NaN so it won't be displayed in the graph?
>
> Maybe try this:
> data(data<0)=NaN
> It index your data basing on the logical array data<0.
> Hope it helps!

thank you, this works!
This solution was so easy, I couldn't even hit on it ;-)