function val = randRange(minVal, maxVal) % Generates a random number within a specified range val = (maxVal - minVal).*rand() + minVal; end