MATLAB: If statement on vector to replace values

if statementMATLABmatrixvector

Hi all,
So i'd like to change a Matrix ((86400×1 double) or vector) which contains 1 colum and 86400 rows with an if statement.
My idea is to check every value if it's smaller than 0, and if so it should be replaced by Zero.
Would be great if someone could help me.
Thanks in advance
Bene

Best Answer

If M is the vector try:
ix = (M<0); M(ix) = 0;