rand_val - % % calling sequence: % randomNumber =...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
function randVal = rand_val(min, max) % RANDVAL is a function to generate pseudo-random numbers based on the % method shown in Example 5.4, p. 211 of Matlab Programming for Engineers, % by Stephen J. Chapman, 2nd. ed., Brooks/Cole. 2002 % % Biological and Environmental Engineering 151, Fall 2004 % Author: Randall N. Umber % Section 8 % TA: Jen R. Ator % Original code: June 25, 2004 % Modifications: August 1, 2005
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: % % calling sequence: % randomNumber = rand_val(smallest, largest) % where smallest is the least value possible and largest is the greatest % % Variable dictionary: % min: smallest possible value % max: largest possible value % randVal: randomize value in range of min to max % randVal = (min + 0.5*(max - min)*(rand + rand)); end % function rand_val...
View Full Document

Ask a homework question - tutors are online