Académique Documents
Professionnel Documents
Culture Documents
Set A
Quiz 1
Question 1 :
Use loop to build up the star pyramid. Use function to take the input.
For example:
Input n = 3
Output:
*
* *
* * *
Question 2:
Write a Matlab code to graphically solve the following fourth order
polynomial.
Y = X 2 + X − 12
Take range of X = [5 5] with step size of 0.01
From the plot, identify the real roots.
Question 3:
Write a M file to compute the square of the variance of the array
A = [2 4 6 0 2 8 9]. Formula for variance is given by
where N= number of elements in the array
x ̅
=average of the array
Question 4:
Write a M file to take a input and print “yes” if the number is multiple of
neither 3 nor 5. Otherwise print “No”.