From: Jan Simon on 10 Jun 2010 07:18 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 10 Jun 2010 07:20 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 10 Jun 2010 07:29 > Try > x(x<0)=x(x<0)+360 Brilliant that worked just how I needed Thanks Jan and Tim! Kev
|
Pages: 1 Prev: Replace Negative values with Non-zero values Next: how to add missing dates |