[R] TRUE/FALSE

Turn & Fall turnandfall at live.co.uk
Mon Aug 9 17:38:19 CEST 2010


Here is my code

		# determine the DDOA measurements 
		for(e in 1:numSensors)
		{
			for(f in 1:numSensors)
			{
				if((combos[e,f]==1)
				{
    			# true distance between each sensor and the target
    			truedistance[e]<-sqrt((targetX-sensorX[e])^2+(targetY-sensorY[e])^2)
    
    			# add an error that has a N(0, sigma^2) distribution 
    			truedistance[e]<-(truedistance[e]+rnorm(1, 0, sigma))
				}
		#truedistance[1] <- (truedistance[1]+50)

			#determine DDOA measurements (reference sensor is sensor #1 here)
		index<-1
		for(e in 1:numSensors)
		{
			if(e!=r)
			{
    					measurement[index]<-(truedistance[f]-truedistance[e]) 
						index <- (index+1)
			}
		}			

			}
				if(combos[e,f]!=1)
				{
				}
		}

combos is just a matrix containing 1's and 0's

This error keeps appearing

Error in if (combos[e, f] == 1) { : missing value where TRUE/FALSE needed


Any ideas?


-- 
View this message in context: http://r.789695.n4.nabble.com/TRUE-FALSE-tp2318668p2318668.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list