"Jesper Lauridsen" <jesperholst_5@hotmail.com> wrote in message <h44342$4iu$1@fred.mathworks.com>...
> I have the following data in a vector called DATA1:
>
> 0.015
> 0.01
> 0.01
> 0.01
> 0.01
> 0.005
> 0.005
> 0.005
> 0.005
> 0.005
> 0.005
> 0.005
> 0.005
> 0.005
>
> What I want is to replace all values that are less or equal to 0.005 with zero in the vector. I was thinking to use some kind of if statement.
>
> if DATA_1<=0.005
> ...........
> else
> ...........
> end
"Jesper Lauridsen" <jesperholst_5@hotmail.com> wrote in message <h44342$4iu$1@fred.mathworks.com>...
> I have the following data in a vector called DATA1:
>
> 0.015
> 0.01
> 0.01
> 0.01
> 0.01
> 0.005
> 0.005
> 0.005
> 0.005
> 0.005
> 0.005
> 0.005
> 0.005
> 0.005
>
> What I want is to replace all values that are less or equal to 0.005 with zero in the vector. I was thinking to use some kind of if statement.
>
> if DATA_1<=0.005
> ...........
> else
> ...........
> end
Hi!
"Jesper Lauridsen" <jesperholst_5@hotmail.com> wrote in message <h44342$4iu$1@fred.mathworks.com>...
> I have the following data in a vector called DATA1:
>
> 0.015
> 0.01
> 0.01
> 0.01
> 0.01
> 0.005
> 0.005
> 0.005
> 0.005
> 0.005
> 0.005
> 0.005
> 0.005
> 0.005
>
> What I want is to replace all values that are less or equal to 0.005 with zero in the vector. I was thinking to use some kind of if statement.
>
> if DATA_1<=0.005
> ...........
> else
> ...........
> end
there can be several methods to do this depending on how you are going to use the filtered data.
try using logical indexing;
e.g;
data = DATA_1(:,1)
zee = (data <= 0.005)
then you can set 'zee' to zero when performing a calculation..
On Jul 21, 5:11 am, "Geant Bepi"
<timothyschru_useonlywhatsbeforeundersc...@yahoo.co.uk> wrote:
> "Jesper Lauridsen" <jesperhols...@hotmail.com> wrote in message <h44342$4i...@fred.mathworks.com>...
> > I have the following data in a vector called DATA1:
>
> > 0.015
> > 0.01
> > 0.01
> > 0.01
> > 0.01
> > 0.005
> > 0.005
> > 0.005
> > 0.005
> > 0.005
> > 0.005
> > 0.005
> > 0.005
> > 0.005
>
> > What I want is to replace all values that are less or equal to 0.005 with zero in the vector. I was thinking to use some kind of if statement.
>
> > if DATA_1<=0.005
> > ...........
> > else
> > ...........
> > end
>
> there can be several methods to do this depending on how you are going to use the filtered data.
> try using logical indexing;
> e.g;
> data = DATA_1(:,1)
> zee = (data <= 0.005)
>
> then you can set 'zee' to zero when performing a calculation..- Hide quoted text -
>
> - Show quoted text -
"Jesper Lauridsen" <jesperholst_5@hotmail.com> wrote in message <h44342$4iu$1@fred.mathworks.com>...
> I have the following data in a vector called DATA1:
>
> 0.015
> 0.01
> 0.01
> 0.01
> 0.01
> 0.005
> 0.005
> 0.005
> 0.005
> 0.005
> 0.005
> 0.005
> 0.005
> 0.005
>
> What I want is to replace all values that are less or equal to 0.005 with zero in the vector. I was thinking to use some kind of if statement.
>
> if DATA_1<=0.005
> ...........
> else
> ...........
> end
Try
NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for
all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content.
Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available
via MATLAB Central.
Read the complete Terms prior to use.