Professional Documents
Culture Documents
P (X) X P (Y) y
P (X) X P (Y) y
P (X) X P (Y) y
p ( x ) =x3 + 8 x 2 +10 x+ 4
p ( y )= y 5 +7 y 4 +19 y 3 +25 y 2+ 16 y+ 4
Write a script to print out the even number and odd number separately from the above vector by using branch
statements and loop
2. A vector is given:
A= [1 2 3 4 5 6 7 8 9 0]
Write a script to print out the vector content using the fprintf command in a loop such that the printout
will look like:
Vector A is
[1, 2, 3, 4, 5, 6, 7, 8, 9, 0]
Print completed.
The argument must accept a scalar as well as a vector. Test your function by typing the following on
MATLAB:
func_es(3)
func_es([1 2 3])