HI Rick, I am simulating a r x c matrix. At each ith row, I have to calculate some statistic, say mean of the j columns. Depending on the value of the mean, I have to assign a value to a M vector using if-then statements. Is there a special way to define the M vector within an if-then loop? My code keeps giving me an error message "Matrix M has not been set to a value." Thanks. -Richard