Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a script that will do the following. Create two vectors with 20 random int

ID: 3542215 • Letter: W

Question

Write a script that will do the following. Create two vectors with 20 random integers in each; in one the integers should range from 1 to 5, and in the other from 1 to 500. For each vector, would you expect the mean and median to be approximately the same? Would you expect the standard deviation of the two vectors be approximately the same? Answer these questions, and then use the built-in functions to find the minimum, maximum, mean, median, standard deviation, and mode of each. Do a histogram for each in a subplot.

Explanation / Answer

% progarm for above problem staement

a=5*rand(1,20)
b=500*rand(1,20)

y1=min(a)
subplot(6,2,1)
hist(y1)
title('min of a vector')
y2=max(a)
subplot(6,2,3)
hist(y2)
title('max of a vector')
y3=mean(a)
subplot(6,2,5)
hist(y3)
title('mean of a vector')
y4=median(a)
subplot(6,2,7)
hist(y4)
title('median of a vector')
y5=std(a)
subplot(6,2,9)
hist(y5)
title('stdandard deviation of a vector')
y6=mode(a)
subplot(6,2,11)
hist(y6)
title('mode of a vector')
z1=min(b)
subplot(6,2,2)
hist(z1)
title('min of b vector')
z2=max(b)
subplot(6,2,4)
hist(z2)
title('max of b vector')
z3=mean(b)
subplot(6,2,6)
hist(z3)
title('mean of b vector')
z4=median(b)
subplot(6,2,8)
hist(z4)
title('median of b vector')
z5=std(b)
subplot(6,2,10)
hist(z5)
title('stdandard deviation of b vector')
z6=mode(b)
subplot(6,2,12)
hist(z6)
title('mode of b vector')


Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote