Using Matlab:

2. (10 pts) A 12-ft wire is cut into eight pieces, which are welded together to form a pyramid as shown below, such that in the rectangular base length (l) is 2 times the width (w) (1 = 2w). The volume of a pyramid is given by: v=LMA The edge length (s) can be determined by: s=3) * + 6) * +12 By rearranging the above expression: n = f*– 6*-* h = 32 a. (6 pts) Create a user-defined Matlab function called pyramidvolume(w) that is only a function of w that will determine the volume of the pyramid with the constraints outlined above (1 = 2w and total material equal to 12 ft.). NOTE: The minimum that w could ever be is O ft. and the maximum that w could ever be is: Wmax = 4.5 – 45/2 1.145 ft. HINT: Given w, I can be determined easily. Once w and I are set, s can be calculated by using the total material length (12 ft.). Now, h can be calculated and finally volume can be determined. To verify that your function is working properly, the volume at the minimum and maximum values of w (given above) should be zero.