Prev: Space one array and other questions
Next: Error: "MATLAB cannot be opened because of a problem"
From: Benedikt Heudorfer on 10 Jun 2010 12:18 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 10 Jun 2010 12:29 "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 10 Jun 2010 12:27 Benedikt Heudorfer wrote: .... > Is there a way to set every data <0 = NaN ... x(x<0)=nan; --
From: Benedikt Heudorfer on 10 Jun 2010 16:47 "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 ;-)
|
Pages: 1 Prev: Space one array and other questions Next: Error: "MATLAB cannot be opened because of a problem" |