hw5p1 - d fprintf('The number of vector values: %.0f\n',...

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

View Full Document Right Arrow Icon
c = 0; max = 0; min = 1000; sumnum = 0; m = 0; Tdif = 0; T vn = randi([10,100]); for c = 1:1:vn; v = randi(1000); sumnum = sumnum + v; if v > max max = v; elseif v < min; min = v; end V(c) = v; end AvgNum = sumnum / vn; for m = 1:1:vn; dif(m) = (V(m)-AvgNum)^2; Tdif = dif(m) + Tdif; end div = Tdif/(vn-1); dev = sqrt(div);
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: d fprintf('The number of vector values: %.0f\n', vn); fprintf('The average number is: %.0f\n', AvgNum); fprintf('The standard deviation of the numbers: %.2f\n', dev); fprintf('The maximum number is: %.0f\n', max); fprintf('The minimum number is: %.0f\n', min);...
View Full Document

This note was uploaded on 09/19/2011 for the course ENGE 1114 taught by Professor Twknott during the Fall '06 term at Virginia Tech.

Ask a homework question - tutors are online