From: Jan Simon on
Dear kev!

> What I want is something like...
> x(x<0)=x+360;

x(x < 0) = x(x < 0) + 360;
or with temp array, which is perhaps faster:
lt_zero = (x < 0);
x(lt_zero) = x(lt_zero) + 360;

Jan
From: Tim Love on
kev <kevwotton(a)gmail.com> writes:

>Hi - I'm sure this is a question that has been asked before but I
>can't seem to find a solution so sorry if this is a repeat question...

>I'm trying to search a vector for negative values and replace them
>with a non zero value
....
>Could anyone advise me on this?

Try
x(x<0)=x(x<0)+360
From: kev on
> Try
>  x(x<0)=x(x<0)+360

Brilliant that worked just how I needed
Thanks Jan and Tim!
Kev