You are on page 1of 5

Student Name: Walker Thompson Lab Section No.

: 31 Class Number: 411 Major


CS

!mail "#W$%: &alker'(&u.edu


)lease complete this sheet* print it and use it as +our co,er sheet.

S -S!..1 / Lab -ssi(nment and 0W 14

)roblem 1. )roblem 3. )roblem 3. Total:

1. points 1. points 1. points 3. points

2222222222 2222222222 2222222222 #rade:222222222

Matlab Exercises

0W14
SEAS-001

Sol,e all (i,en problems b+ creatin( a Matlab m!4ile 4or each problem. 5or each problem* (i,e a separate pa(e sho&in( the m!4ile and Matlab solution 6n each pa(e* print problem number* +our name and +our class number. 7ou M$ST turn it in the be(innin( o4 the ne8t lab9 this is absolutel+ +our last chance to turn in +our &ork.

)lot the 4ollo&in( 4unctions and 4ind the Ma8imum and Minimum ,alues attained 4or each o4 them &ithin the (i,en ran(e o4 ,alues.
)roblem 1. a) Generate values for x between 0 and 4 in steps of 0.25. x= 0:.25:4 b) Calculate the Maximum and Minimum values attained for the function f1.

1 1 f1 = + 2 2 ! x 0.") + 0.1 ! x 0.#) + 0.01


f1 $ !1.%!!x-.").&2)'.1)'!1.%!!x-.#).&2) '.01)- ( max!f1) min!f1) c) )lot x vs. f1 fi*ure!2)( +lot!x, f1) hold on - needs to .oom

)roblem 3. a) Generate values for N between -10 and 10 in steps of 1 . / $ -1001010 b) Calculate the Maximum and Minimum values attained for the function f2.

1 2N f2 = 2 2 2 !1 + N ) !1 + N )
f2 $ !1.%!1 ' !/.&2)))-!2.1/.%!1'!/.&2)).&2)( max!f2) min!f2) b) )lot N vs. f2 fi*ure!")( +lot!/,/,2bx2,/,f2,2r.2),sh*

)roblem 3. a) Generate values for M between -2 and 2 in steps of 0.25 . M $ -20.2302

b)

Calculate the Maximum and Minimum values attained for the function f".

1 2 1 1 f" = M + 2 M M " 2 "

f" $ !!-1.%").1!M.&2)) ' !2.1!!1.%2)-!1.%").1M).1M)( max!f") min!f") c) )lot M vs. f3 fi*ure!4)( +lot!M,M,2bx2,M,f",2r.2),sh*

5ints0 1. 6se the 7dot7 arithmetic o+erations in all the +roblems. 8hese are needed 9hen :ou are 9or;in* 9ith arra:s or lists of numbers. 2. 8r: learnin* and usin* the commands <max!)= and <min!)=. 8:+e in <hel+ max= at the MA8>A? command +rom+t to learn their usa*e.

You might also like