Week3 Lab HW Matlab
Week3 Lab HW Matlab
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.
)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*
b)
Calculate the Maximum and Minimum values attained for the function f".
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.