% first plot a straight line: y = inline ( 'x + 10') fplot (y, [0, 110, 0, 120]) % This is a traight line with slope 1, and y-intercept 10 hold on; % hold on to the picture so we can have sxeveral plots on the screen % at the same time. xp = [100]; % define an array of length 100 yp = [100]; % ditto r = 5 .* rand(100) - 2.5; % define an array of length 100 whose entries are % between -2.5 and +2.5 % construct a function which is a straight line y (x) plus a % random component (white noise): for i = 1:100 xp (i) = i; yp (i) = y (xp(i)) + r(i); end plot (xp, yp, 'Color', 'red') % plot the result.